[Pypgsql-users] Re: postgresql notifications

Adam Buraczewski adamb at polbox.pl
Wed May 28 18:30:29 EDT 2003


On Wed, May 28, 2003 at 02:18:42PM +0200, Gerhard Häring wrote:
> >>The pyPgSQL source distribution includes examples for notifications 
> >>(examples/demo2a.py, examples/demo2b.py).
> >>Please report back if you still have problems.
[...]
> They did certainly work for me last time I checked.
> 
> Do you have different versions of the PostgreSQL client library and the 
> server? If for example you use a 7.3 client and a 7.2 server there might 
> be some problems ... Just a rough guess of me of course.

I quickly checked my installation of PostgreSQL + pyPgSQL and NOTIFY
messages do not work either.  I have Python 2.2.2, PostgreSQL 7.3.2
and pyPgSQL 2.3, everything compiled and installed from sources.  The
problem is that although NOTIFY messages are sent to the client, thay
are not correctly decoded by pyPgSQL library.

The result of running demo2a and demo2b is:

Waiting.....
ASYNC NOTICE of 'P*' from backend pid 1066 recieved
Waiting.....
ASYNC NOTICE of '*' from backend pid 1066 recieved
Waiting...........
ASYNC NOTICE of 'P*' from backend pid 1066 recieved

The string 'P*' or '*' is random and each run of demo programs shows
something different here.  Sometimes these characters are even
non-ASCII.  Everything works under plain psql, however: when I run
demo2b, psql prints:

Asynchronous NOTIFY 'demo2a' from backend with pid 1089 received.
Asynchronous NOTIFY 'demo2a' from backend with pid 1089 received.
Asynchronous NOTIFY 'demo2a' from backend with pid 1089 received.

Regards,

-- 
Adam Buraczewski <adamb at polbox.pl> * Linux registered user #165585
GCS/TW d- s-:+>+:- a- C+++(++++) UL++++$ P++ L++++ E++ W+ N++ o? K? w--
O M- V- PS+ !PE Y PGP+ t+ 5 X+ R tv- b+ DI? D G++ e+++>++++ h r+>++ y?





More information about the Python-list mailing list