Re: Multiple NOTIFY is ignored

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Multiple NOTIFY is ignored
Дата
Msg-id 91fc6bbc-4086-c7a2-b9ce-9be040b7cfca@aklaver.com
обсуждение исходный текст
Ответ на Multiple NOTIFY is ignored  (Markus Kolb <markus.kolb+postgres@tower-net.de>)
Ответы Re: Multiple NOTIFY is ignored  (Markus Kolb <markus.kolb+postgres@tower-net.de>)
Список pgsql-general
On 07/28/2016 07:29 AM, Markus Kolb wrote:
> Hi,
>
> I've a question to the pgsql NOTIFY feature...
>
> I use something like
>
> SELECT dblink_connect('{0}', '{1}'); SELECT dblink('{2}', '{3}'); SELECT
> dblink_disconnect('{4}');
> where {3} is
> NOTIFY upd_pgm, '0|UPDATE|A|'
>
> SELECT dblink_connect('{0}', '{1}'); SELECT dblink('{2}', '{3}'); SELECT
> dblink_disconnect('{4}');
> where {3} is
> NOTIFY upd_pgm, '0|DELETE|A|'
>
> This works. Both notify are recognized.
>
> If I only do one
> SELECT dblink_connect('{0}', '{1}'); SELECT dblink('{2}', '{3}'); SELECT
> dblink_disconnect('{4}');
> where {3} is
> NOTIFY upd_pgm, '0|UPDATE|A|'; NOTIFY upd_pgm, '0|DELETE|A|'
>
> only the notify with UPDATE is recognized.
>
> For further explanation... the working solution uses separate dblink
> connections and calls for each notify.
> Where as the not working tries to use only one dblink connection and call.
>
> As far as I can read from the documentation...
> "If the same channel name is signaled multiple times from the same
> transaction with identical payload strings, the database server can
> decide to deliver a single notification only. On the other hand,
> notifications with distinct payload strings will always be delivered as
> distinct notifications."
> (https://www.postgresql.org/docs/current/static/sql-notify.html)
>
> Here the channel name is identical, but the payload differs with
> UPDATE/DELETE.
>
> So why the 2nd notify is not delivered/recognized?

At a guess the second NOTIFY is not completed by ;

>
> Thanks
> Markus
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Moreno Andreo
Дата:
Сообщение: Re: WAL directory size calculation
Следующее
От: Rakesh Kumar
Дата:
Сообщение: Re: Uber migrated from Postgres to MySQL