agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: abctevez <swqshapu@163.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: does the notification of postgres appear in transaction completed order
Date: Fri, 16 Mar 2018 10:57:19 -0400
Message-ID: <19761.1521212239@sss.pgh.pa.us> (raw)
In-Reply-To: <3bc63b9d.f064.1622f0c0a46.Coremail.swqshapu@163.com>
References: <3bc63b9d.f064.1622f0c0a46.Coremail.swqshapu@163.com>

abctevez <swqshapu@163.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




view thread (2+ messages)

Message-ID: <19761.1521212239@sss.pgh.pa.us>
Permalink:  ../19761.1521212239@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19761.1521212239@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, swqshapu@163.com
  Subject: Re: does the notification of postgres appear in transaction completed order
  In-Reply-To: <19761.1521212239@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox