Re: NOTIFY payload patch

"A.M." <agentm-/iWpWt6iY7eAP89PaY/[email protected]> Thu, 26 Aug 2010 10:33:07 -0400
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Aug 26, 2010, at 5:31 AM, Federico Di Gregorio wrote:

> On 08/25/10 21:39, A.M. wrote:
> [snip]
>> Note that this will break code which unpacks the tuple in an
>> assignment:
>> 
>> (pid,name)  = dbconn.notifies.pop()
>> 
>> must become
>> 
>> (pid,name,payload) = dbconn.notifies.pop()
>> 
>> but as long as pop() doesn't return a Notification object, I don't
>> see a way around this.
>> 
>> This patch was tested successfully against 8.4 and 9.0b4 libpq
>> against a 9.0b4 server with an without payloads passed.
> 
> Thank you very much for this patch. I don't like breakages so, probably,
> the best thing would be to substitute the tuple with an instance of a
> Notify class (as you suggest) that has both 3 attributes (for pid, name
> and payload) and can be indexed like a tuple composed of two elements.

That's a good plan- I will work on this.

Cheers,
M