Re: does the notification of postgres appear in transaction completed order

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: abctevez <swqshapu(at)163(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: does the notification of postgres appear in transaction completed order
Date: 2018-03-16 14:57:19
Message-ID: 19761.1521212239@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

abctevez <swqshapu(at)163(dot)com> writes:
> I want to use notify/listen to catch the message that a transaction completed.Fire notify in trigger and as the official said, it won't notify if transaction rollback.However, I am wondering if the message appear in the same order with transaction execution.I couldn't find this topic on the official web or just I missed it?

https://www.postgresql.org/docs/current/static/sql-notify.html

says

Except for dropping later instances of duplicate notifications, NOTIFY
guarantees that notifications from the same transaction get delivered
in the order they were sent. It is also guaranteed that messages from
different transactions are delivered in the order in which the
transactions committed.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message abctevez 2018-03-29 06:46:17 when transaction is committed in postgres
Previous Message abctevez 2018-03-16 13:42:20 does the notification of postgres appear in transaction completed order