Re: statement_timeout doesn't work

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: statement_timeout doesn't work
Date: 2014-07-21 14:59:01
Message-ID: CAL_0b1t90hSmF43+RHrZqM-z9_p_udNARM_k1SQfP-L_Ay=ZsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 18, 2014 at 6:15 PM, David G Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>> query | BEGIN;
>> SET LOCAL statement_timeout TO 1000;
>> DROP INDEX public.idx1;
>> ALTER INDEX public.idx2 RENAME TO idx1;
>> END;
>
> If I read this correctly you sent the entire begin...end as a single
> compound statement and so, depending on how you did this, the actual SET
> LOCAL command never got executed since the entire command is waiting for the
> necessary locks before it can be executed.

Right, I send it as a single command.

> Your sample test doesn't appear to correctly exercise this behavior. Are
> you maybe using -c in the problem case? Or a client library besides psql
> that would behave in this manner?

In this case I use DBD::Pg, but I haven't found any notes about such
kind of behavior.

> Note that the fact that "query" is a compound statement is why I claim the
> above...

So, If I separate the commands everything will will work as expected, correct?

>
> David J.
>
>
>
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/statement-timeout-doesn-t-work-tp5811704p5812037.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (499) 346-7196, +7 (988) 888-1979
gray(dot)ru(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karthik Iyer 2014-07-21 15:35:18 Upgrade to 9.3
Previous Message Tom Lane 2014-07-21 14:17:58 Re: check database integrity