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 1h9xLC-0007dU-Im for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 19:39:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9xLB-0006l9-6A for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2019 19:39:01 +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 1h9xLA-0006l1-Tt for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 19:39:00 +0000 Received: from feynman.df7cb.de ([195.49.152.168]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9xL8-0008L8-Qf for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2019 19:39:00 +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 44WBr05NSFz3F1Z; Fri, 29 Mar 2019 20:38:56 +0100 (CET) Date: Fri, 29 Mar 2019 20:38:54 +0100 From: Christoph Berg To: Pavel Stehule Cc: Tom Lane , Andres Freund , Tatsuo Ishii , Andreas Karlsson , Tomas Vondra , eldmannen@gmail.com, mark.kirkwood@catalyst.net.nz, Michael Paquier , Chris Travers , Alvaro Herrera , Euler Taveira , rjuju123@gmail.com, PostgreSQL Hackers Subject: Re: PostgreSQL pollutes the file system Message-ID: <20190329193854.GC19154@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> <20190329185031.GA19154@msg.df7cb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Re: Pavel Stehule 2019-03-29 > > 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' > > > > Prepared statements cannot be DDL commands. "Prepared" in the sense of what format() does. (I should have used %I.) > But psql has safe escaping via :"xxx" notation. So some like > > psql -c 'create role :"role"' -v role='my role' ... That's totally horrible to write, get correct, and to read again later. We need something that people can actually use. > But what I know the psql variables are not evaluated for -c query I hate -c. It has so many caveats. Christoph