From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Berg <christoph.berg@credativ.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #9198: psql -c 'SET; ...' not working
Date: Thu, 13 Feb 2014 11:45:00 -0500
Message-ID: <5270.1392309900@sss.pgh.pa.us> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Christoph Berg <christoph.berg@credativ.de> writes:
> ... I'd propose something like this doc update:
> <application>psql</application>'s standard input. Also, only
> ! the result of the last SQL command is returned. <command>SET</>
> ! commands that modify statement behavior will be ineffective because
> ! they are part of the already running statement. Most notably,
> ! <literal>psql -c 'SET statement_timeout = 0; SELECT ...'</literal>
> ! will not work as expected. (Use <literal>echo '...' | psql</literal>
> ! 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
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: tgl@sss.pgh.pa.us, christoph.berg@credativ.de
Subject: Re: BUG #9198: psql -c 'SET; ...' not working
In-Reply-To: <5270.1392309900@sss.pgh.pa.us>
References: <20140212125626.2710.94912@wrigleys.postgresql.org> <25094.1392219652@sss.pgh.pa.us> <20140213131858.GB25703@msgid.credativ.de> <5270.1392309900@sss.pgh.pa.us>
* 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