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 1h9waT-0001lP-4E for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 18:50:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9waQ-0005C4-HA for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 18:50:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9waQ-0005Bp-4W for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 18:50:42 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9waI-0008NF-J6 for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 18:50:40 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1478:70e0:76e5:bff:fef3:7e00]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by feynman.df7cb.de (Postfix) with ESMTPSA id 44W9m761gfz3Dws; Fri, 29 Mar 2019 19:50:31 +0100 (CET) Date: Fri, 29 Mar 2019 19:50:31 +0100 From: Christoph Berg To: Tom Lane Cc: Andres Freund , Tatsuo Ishii , andreas@proxel.se, tomas.vondra@2ndquadrant.com, eldmannen@gmail.com, mark.kirkwood@catalyst.net.nz, michael@paquier.xyz, chris.travers@adjust.com, alvherre@2ndquadrant.com, euler@timbira.com.br, rjuju123@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: PostgreSQL pollutes the file system Message-ID: <20190329185031.GA19154@msg.df7cb.de> References: <20190327142657.GC17983@development> <375ea28a-2e8c-9954-66b1-bd0a3ff657f5@proxel.se> <18182.1553697687@sss.pgh.pa.us> <20190329.100407.1159785913847835944.t-ishii@sraoss.co.jp> <20190329152557.GI20294@msg.df7cb.de> <24256.1553874086@sss.pgh.pa.us> <20190329155121.5zyoahgh4i2r4ayl@alap3.anarazel.de> <19517.1553876700@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19517.1553876700@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Re: Tom Lane 2019-03-29 <19517.1553876700@sss.pgh.pa.us> > >> Or perhaps better, allow pg_ctl to grow new subcommands for those > >> tasks? > > > We'd need to be careful to somehow delineate commands that need access > > to the data directory / run locally on the server from the ones that > > just needs a client connection. > > Hmm, that's a good point: to put it in terms that make sense to a > packager, it'd no longer be clear whether pg_ctl belongs in the > server package or the client package. True, and putting end-user commands like "create database" into the same admin tool like "stop", "promote", and "kill" feels both wrong and dangerous to me. It would also cause people to wonder why "pg_ctl -h remotehost stop" doesn't work. > I'm still not thrilled with wedging in these things as options > to psql though: its command line semantics are overly complicated > already, when you consider things like multiple -c and -f options. > I mean, somebody might think it's a feature to be able to do > > psql --createuser alice --createuser bob -c 'some command' -f somefile > > but I don't. Ack. (Otoh, just processing all arguments after another might be well-defined, and not too hard?) > Maybe if we want to merge these things into one executable, > it should be a new one. "pg_util createrole bob" ? "pg" is unfortunately already taken :( Fwiw, let's please keep supporting "createuser". Creating login roles is more common than non-login ones, and having to type "createrole --login bob" is cumbersome and will cause endless support requests by confused users. Other idea: If we don't want to reinvent a new tool, how about supporting prepared statements in psql? psql -c 'create user %i' --args 'bob w. space' Christoph