Re: timeout implementation issues

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: timeout implementation issues
Дата
Msg-id 20396.1018274897@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: timeout implementation issues  (Karel Zak <zakkr@zf.jcu.cz>)
Ответы Re: timeout implementation issues  (Jan Wieck <janwieck@yahoo.com>)
Re: timeout implementation issues  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Karel Zak <zakkr@zf.jcu.cz> writes:
>  Is there some problem implement "SET ... ON ROLLBACK UNSET" ?

Yes.  See my previous example concerning search_path: that variable
MUST be rolled back at transaction abort, else we risk its value being
invalid.  We cannot offer the user a choice.

So far I have not seen one single example against SET rollback that
I thought was at all compelling.  In all cases you can simply issue
the SET in a separate transaction if you want to be sure that its
effects persist.  And there seems to be no consideration of the
possibility that applications might find SET rollback to be useful.
ISTM that the example with JDBC and query_timeout generalizes to other
parameters that you might want to set on a per-statement basis, such
as enable_seqscan or transform_null_equals.  Consider
BEGIN;SET enable_seqscan = false;some-queries-that-might-fail;SET enable_seqscan = true;END;

This does not work as intended if the initial SET doesn't roll back
upon transaction failure.  Yeah, you can restructure it to
SET enable_seqscan = false;BEGIN;some-queries-that-might-fail;END;SET enable_seqscan = true;

but what was that argument about some apps/drivers finding it
inconvenient to issue commands outside a transaction block?
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: timeout implementation issues
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: timeout implementation issues