Re: LISTEN considered dangerous

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: LISTEN considered dangerous
Дата
Msg-id 87lkq7w6t9.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: LISTEN considered dangerous  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> I would still expect any reimplementation of notify messaging to honor the
> principle that a LISTEN doesn't take effect till you commit. Otherwise, what
> of
>
>     BEGIN;
>     LISTEN foo;
>     ROLLBACK;
>
> ?  If I get some events for foo after this I'd surely think it was
> broken.

Well the rollback would roll back any consequences of the notify handler
firing too. So the transactional nature would still be maintained.

I'm not sure why you're imagining that the listen would still be in effect
after the rollback. rollback would return the connection state to the same
state it was in before the transaction.

I Think of GUC variables like enable_* as a good analogy. If you fiddle with
them their effects are felt immediately by your transaction. You don't have to
commit to make those changes take effect. If you roll back your changes their
original state is restored.

--
greg

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

Предыдущее
От: "Carlo Stonebanks"
Дата:
Сообщение: Re: plTcl - how to create proc/function libraries
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: LISTEN considered dangerous