Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6yIf-0001zw-Dk for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Mar 2019 14:04:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6yId-0007I9-Sr for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Mar 2019 14:04:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6yHT-0003M8-36 for pgsql-hackers@lists.postgresql.org; Thu, 21 Mar 2019 14:02:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6yHQ-0008NH-TK for pgsql-hackers@lists.postgresql.org; Thu, 21 Mar 2019 14:02:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x2LE2eCu010037; Thu, 21 Mar 2019 10:02:40 -0400 From: Tom Lane To: Andreas Karlsson cc: Chris Travers , Michael Paquier , Tatsuo Ishii , Tomas Vondra , Alvaro Herrera , euler@timbira.com.br, rjuju123@gmail.com, "Fred .Flintstone" , Postgres hackers Subject: Re: PostgreSQL pollutes the file system In-reply-to: References: <20190320180832.GA11614@alvherre.pgsql> <754d8607-682e-6f59-6870-faee5fa0820c@2ndquadrant.com> <20190321.084132.2186284141219540889.t-ishii@sraoss.co.jp> <20190321004919.GE20192@paquier.xyz> Comments: In-reply-to Andreas Karlsson message dated "Thu, 21 Mar 2019 13:12:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <10035.1553176960.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Thu, 21 Mar 2019 10:02:40 -0400 Message-ID: <10036.1553176960@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andreas Karlsson writes: > On 3/21/19 7:07 AM, Chris Travers wrote: >> 1.  createuser/dropuser are things that I don't consider good ways of >> creating users anyway. > Those binaries are pretty convenient to use in scripts since they handle > SQL escaping for you, but probably not convenient enough that we would > have added createuser today. > Compare > createuser "$USER" > vs > echo 'CREATE ROLE :"user" LOGIN' | psql postgres -v "user=$USER" Hmm. That example is actually quite scary, because while nearly anybody who's ever done any shell scripting would get the first one right, the second one requires a fair deal of specialized knowledge and creativity. I fear that 99% of people would have coded it like echo "CREATE USER $USER" | psql or some variant on that, and now they have a SQL-injection hazard that they didn't have before. So there seems like a real risk that taking away createuser would result in security holes, not just annoying-but-trivial script update work. That puts me more in the camp of "if we're going to do anything, rename it with a pg_ prefix" than "if we're going to do anything, remove it". regards, tom lane