pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: christoph.berg@credativ.de
To: pgsql-bugs@postgresql.org
Subject: BUG #9198: psql -c 'SET; ...' not working
Date: Wed, 12 Feb 2014 12:56:26 +0000
Message-ID: <20140212125626.2710.94912@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      9198
Logged by:          Christoph Berg
Email address:      christoph.berg@credativ.de
PostgreSQL version: 9.3.2
Operating system:   Linux
Description:        

This seems to be a bug:

# alter role cbe set statement_timeout = '1s';

psql -c "SHOW statement_timeout"
 statement_timeout
-------------------
 1s

psql -c "SET statement_timeout = '3s'; SHOW statement_timeout"
 statement_timeout
-------------------
 3s

time psql -c "SET statement_timeout = '3s'; SELECT pg_sleep(2)"
ERROR:  canceling statement due to statement timeout
real    0m1.065s

As witnessed by the time output, the timeout is the one from ALTER ROLE, not
the new one. Seen on 9.2 and 9.3.

The psql docs mention that -c is treated differently from stdin when
multiple commands are executed, but that shouldn't include SET not getting
into effect.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <20140212125626.2710.94912@wrigleys.postgresql.org>
Permalink:  ../20140212125626.2710.94912@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140212125626.2710.94912@wrigleys.postgresql.org

 · 

reply

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: christoph.berg@credativ.de
  Subject: Re: BUG #9198: psql -c 'SET; ...' not working
  In-Reply-To: <20140212125626.2710.94912@wrigleys.postgresql.org>
  References: <20140212125626.2710.94912@wrigleys.postgresql.org>

* 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