Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDyu6-0001Qc-SL for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:12:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WDyu6-0003I6-0y for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Feb 2014 16:12:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDyu5-0003Hy-2r for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:12:45 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WDyty-00049k-Cc for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 16:12:44 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WDytx-0004Cp-86 for pgsql-bugs@postgresql.org; Thu, 13 Feb 2014 08:12:37 -0800 Date: Thu, 13 Feb 2014 08:12:37 -0800 (PST) From: David Johnston To: pgsql-bugs@postgresql.org Message-ID: <1392307957238-5791873.post@n5.nabble.com> In-Reply-To: <25094.1392219652@sss.pgh.pa.us> References: <20140212125626.2710.94912@wrigleys.postgresql.org> <25094.1392219652@sss.pgh.pa.us> Subject: Re: BUG #9198: psql -c 'SET; ...' not working MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 1.8 (+) 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 Tom Lane-2 wrote > The reason this isn't a bug is that a -c command string is sent to the > server as a single statement (PQexec call), and what "statement timeout" > controls is the total time for the whole thing. The SET operation can't > change the already-running timer for the current statement. It would > affect the timeout for the next statement ... but there won't be one. The wording of the documentation implies, though, that a single statement has component statements that are independently subject to transaction semantics. "If the command string contains multiple SQL commands, they are processed in a single transaction, unless there are explicit BEGIN/COMMIT commands included in the string to divide it into multiple transactions." Is there any support for making these component statements also operate on their own timeout timers? This is not that infrequent a question and at minimum the documentation could be more clear. That people are wanting to do this means that enhancement is something to consider as well - though not something that strikes me as being that useful generally. I am thinking something like "substatement_timeout" that if unset would resolve to the current value of "statement_timeout" but if set would cause all subsequent sub-statements to operate on that timer while the entire super-statement would continue to operate on the original timer. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-9198-psql-c-SET-not-working-tp5791581p5791873.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs