From: | Filip Rembiałkowski <filip(dot)rembialkowski(at)gmail(dot)com> |
---|---|
To: | Vik Fearing <vik(at)2ndquadrant(dot)fr> |
Cc: | Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal: make NOTIFY list de-duplication optional |
Date: | 2016-02-08 01:37:39 |
Message-ID: | CAP_rwwkva10=z82ak1eQjBOCHLq6bXMf=5MsAfi6Oowu73kpGg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Sun, Feb 7, 2016 at 4:37 PM, Vik Fearing <vik(at)2ndquadrant(dot)fr> wrote:
>>> There is also no mention in the documentation about what happens if I do:
>>>
>>> NOTIFY ALL chan, 'msg';
>>> NOTIFY ALL chan, 'msg';
>>> NOTIFY DISTINCT chan, 'msg';
>>> NOTIFY ALL chan, 'msg';
>>>
>>> Without testing, I'd say I'd get two messages, but it should be
>>> explicitly mentioned somewhere.
>>
>> If it's four separate transactions, LISTEN'er should get four.
>
> The question was for one transaction, I should have been clearer about that.
>
>> If it's in one transaction, LISTEN'er should get three.
>
> This is surprising to me, I would think it would get only two. What is
> your rationale for three?
>
It is a single transaction, but four separate commands.
>>> NOTIFY ALL chan, 'msg';
-- send the message, save in the list/hash
>>> NOTIFY ALL chan, 'msg';
-- ALL was specified, send the message even if it is on the list/hash
>>> NOTIFY DISTINCT chan, 'msg';
-- default mode, skip message because it's in the list/hash
>>> NOTIFY ALL chan, 'msg';
-- ALL was specified, send the message even if it is hashed/saved
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2016-02-08 02:37:17 | Re: [PROPOSAL] VACUUM Progress Checker. |
Previous Message | Haribabu Kommi | 2016-02-08 01:37:02 | Re: Combining Aggregates |