Re: NOTIFY payload patch

Federico Di Gregorio <fog-NGVKUo/i/[email protected]> Thu, 26 Aug 2010 11:31:21 +0200
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============0311915119516028474==
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature";
 boundary="------------enigDD28D110D90810B92688C722"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigDD28D110D90810B92688C722
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 08/25/10 21:39, A.M. wrote:
[snip]
> Note that this will break code which unpacks the tuple in an
> assignment:
>=20
> (pid,name)  =3D dbconn.notifies.pop()
>=20
> must become
>=20
> (pid,name,payload) =3D dbconn.notifies.pop()
>=20
> but as long as pop() doesn't return a Notification object, I don't
> see a way around this.
>=20
> 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.

federico

--=20
Federico Di Gregorio                                       fog-NGVKUo/i/[email protected]
 In some countries (e.g., Germany) even many brands of toilet paper have
  format A6.             [http://www.cl.cam.ac.uk/~mgk25/iso-paper.html]


--------------enigDD28D110D90810B92688C722
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx2NGkACgkQvcCgrgZGjeuusgCgu+VzZgWrjUE9IB4dRXHKfnjl
01wAn3LukOQY0VeXAXcqEN+8uK7Simwi
=4x8L
-----END PGP SIGNATURE-----

--------------enigDD28D110D90810B92688C722--

--===============0311915119516028474==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg

--===============0311915119516028474==--