Обсуждение: new notify payload as string

Поиск
Список
Период
Сортировка

new notify payload as string

От
"A.M."
Дата:
With 9.0b4, I am testing the new NOTIFY payload feature. One thing I noticed is that it seems impossible to
differentiateat the receiving end from: 

NOTIFY test;

and

NOTIFY test,'';

So, it is impossible to differentiate between a notification with an empty string payload and a notification without a
payloaddue to the backend protocol defining the payload as a string. Perhaps a boolean could be added to the backend
protocolto account for this and then "extra" could be set to NULL in libpq. 

This could be handy when converting codebases that use LISTEN/NOTIFY when one wishes to be warned of "old" NOTIFYs
beingused without a payload. 

Cheers,
M

Re: new notify payload as string

От
Tom Lane
Дата:
"A.M." <agentm@themactionfaction.com> writes:
> So, it is impossible to differentiate between a notification with an
> empty string payload and a notification without a payload due to the
> backend protocol defining the payload as a string.

That's correct.  This was baked into the FE/BE protocol in 2003;
we're not going to change it now, especially not without a pretty
convincing argument why it's critical functionality to have.
        regards, tom lane