statement_timeout doesnt work within plpgsql by design?

From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: statement_timeout doesnt work within plpgsql by design?
Date: 2007-02-20 17:00:53
Message-ID: 200702201200.53535.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pagila=# select version();
version
-------------------------------------------------------------
PostgreSQL 8.2.3 on i386-pc-solaris2.10, compiled by cc -Xa
(1 row)

pagila=# create or replace function test() returns bool as $$ begin set
statement_timeout = 3000; perform pg_sleep(4) ; return true; end $$ language
plpgsql;
CREATE FUNCTION
pagila=# select test();
test
------
t
(1 row)

pagila=# select test();
ERROR: canceling statement due to statement timeout
CONTEXT: SQL statement "SELECT pg_sleep(4)"
PL/pgSQL function "test" line 1 at perform

is this behavior by design? if so why would you design it that way? :-)

--
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-02-20 17:50:28 Re: statement_timeout doesnt work within plpgsql by design?
Previous Message August Zajonc 2007-02-20 16:39:46 Re: New feature request: FlashBack Query