Re: BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY
Дата
Msg-id 12564.1100213588@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Список pgsql-bugs
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
> CREATE OR REPLACE FUNCTION fn_test()
>   RETURNS "varchar" AS
> $BODY$
> DECLARE
>    c refcursor;
>    r record;
> BEGIN
>    SET SESSION STATEMENT_TIMEOUT = 1000;
>    OPEN C FOR SELECT * FROM T_KULLANICILAR FOR UPDATE;
>    FETCH C INTO R;
>    RESET STATEMENT_TIMEOUT;
>    RETURN '1';
> EXCEPTION
>    WHEN QUERY_CANCELED THEN
>           RAISE EXCEPTION 'UNABLE TO OBTAIN LOCK... :%';
> END;
> $BODY$

statement_timeout limits the time taken for an *interactive* command,
not the time for an individual command inside a function.  What this
means is you can't change it around inside a function and expect
anything to happen --- the timeout, or lack of it, for the current
interactive command was determined long before your function got called.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1314: STATEMENT_TIMEOUT DOES NOT WORK PROPERLY
Следующее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1315: unconvertible BIG5 character 0xf9d8