pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: rekgrpth@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17303: statement_timeout does not work always
Date: Mon, 29 Nov 2021 09:53:15 -0500
Message-ID: <1216509.1638197595@sss.pgh.pa.us> (raw)
In-Reply-To: <17303-b5932dfa7e8355be@postgresql.org>
References: <17303-b5932dfa7e8355be@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> in postgres 10.19
> psql -c "SET statement_timeout = 1000;select pg_sleep(2);"
>  pg_sleep 
> ----------
 
> (1 row)

> Why statement_timeout does not work always in postgres 10.19?

When you use -c that way, the two statements are sent as a single Query
message.  PG versions before 11 interpreted the timeout as taking effect
beginning with the next Query message.  11 and later define it
differently.  There's no bug here, or at least nothing we're going to change.

A workaround you could use in older versions is to use two separate -c
switches (although you need a 9.6 or later psql for that).

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <1216509.1638197595@sss.pgh.pa.us>
Permalink:  ../1216509.1638197595@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1216509.1638197595@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, rekgrpth@gmail.com
  Subject: Re: BUG #17303: statement_timeout does not work always
  In-Reply-To: <1216509.1638197595@sss.pgh.pa.us>
  References: <17303-b5932dfa7e8355be@postgresql.org> <1216509.1638197595@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