Re: [GENERAL] NOTIFY command impact - Mailing list pgsql-general

From Rob Brucks
Subject Re: [GENERAL] NOTIFY command impact
Date
Msg-id 7D2B5776-4114-4D83-9260-D6D39290BEEA@rackspace.com
Whole thread Raw
In response to Re: [GENERAL] NOTIFY command impact  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [GENERAL] NOTIFY command impact  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general

I did find a post a while back saying they were discarded, but I wanted to double-check.

 

I performed some tests to see if listens worked AFTER the notify was issued, they were not.  This leads me to believe that the messages are discarded when a listen does not yet exist.

 

--Rob

 

From: "David G. Johnston" <david.g.johnston@gmail.com>
Date: Tuesday, February 21, 2017 at 3:38 PM
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Rob Brucks <rob.brucks@rackspace.com>, "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] NOTIFY command impact

 

On Tue, Feb 21, 2017 at 2:17 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

On 02/21/2017 01:07 PM, Rob Brucks wrote:


Do you see any long-term problems with constantly issuing "NOTIFY"
commands every 30 seconds without an associated "LISTEN" command?

 

Depending on how long 'long term' is:

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

"There is a queue that holds notifications that have been sent but not yet processed by all listening sessions

 

​Its not clear in the OP that this is the case (it seems to be) but the documentation is non-specific as to what happens when "# of listeners" = 0;  I suspect that said messages are created and then immediately discarded - though apparently they do make it over to the standby server​ too - and likely also immediately discarded there as well.

 

David J.

 

pgsql-general by date:

Previous
From: Rob Brucks
Date:
Subject: Re: [GENERAL] NOTIFY command impact
Next
From: Stephen Frost
Date:
Subject: Re: R: R: [GENERAL] Slow queries on very big (and partitioned) table