From: David Johnston <polobo@yahoo.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #9198: psql -c 'SET; ...' not working
Date: Thu, 13 Feb 2014 08:12:37 -0800 (PST)
Message-ID: <1392307957238-5791873.post@n5.nabble.com> (raw)
In-Reply-To: <25094.1392219652@sss.pgh.pa.us>
References: <20140212125626.2710.94912@wrigleys.postgresql.org>
<25094.1392219652@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: polobo@yahoo.com
Subject: Re: BUG #9198: psql -c 'SET; ...' not working
In-Reply-To: <1392307957238-5791873.post@n5.nabble.com>
References: <20140212125626.2710.94912@wrigleys.postgresql.org> <25094.1392219652@sss.pgh.pa.us> <1392307957238-5791873.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox