Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzPP-0002Wa-Ah for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:45:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WDzPO-0000AX-RB for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:45:06 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzPO-0000AQ-6A for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:45:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDzPL-0000TR-JW for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:45:05 +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 s1DGj0Vq005271; Thu, 13 Feb 2014 11:45:00 -0500 From: Tom Lane To: Christoph Berg cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9198: psql -c 'SET; ...' not working In-reply-to: <20140213131858.GB25703@msgid.credativ.de> References: <20140212125626.2710.94912@wrigleys.postgresql.org> <25094.1392219652@sss.pgh.pa.us> <20140213131858.GB25703@msgid.credativ.de> Comments: In-reply-to Christoph Berg message dated "Thu, 13 Feb 2014 14:18:58 +0100" Date: Thu, 13 Feb 2014 11:45:00 -0500 Message-ID: <5270.1392309900@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Christoph Berg writes: > ... I'd propose something like this doc update: > psql's standard input. Also, only > ! the result of the last SQL command is returned. SET > ! commands that modify statement behavior will be ineffective because > ! they are part of the already running statement. Most notably, > ! psql -c 'SET statement_timeout = 0; SELECT ...' > ! will not work as expected. (Use echo '...' | psql > ! as above instead.) This is incorrect though; most variables you can set via SET actually will work unsurprisingly in this context. statement_timeout is different because its value is only inspected at the start of a statement (where "statement" is defined as "query string received from the client"). regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs