From: <gh...@gh...> - 2003-05-28 12:23:07
|
[Cc-ed to pypgsql-users - I'd recommend to take this discussion over there] Witek wrote: > Gerhard Häring wrote: > >>> I'm using pypgsql to connect to postgresql database (7.2, 7.3). >>> I recieve PgNotify object using notifies() method of connection >>> object, but it's fields values are random chars and wrong process id. >>> Is there someone, who put it to work? >> >> The pyPgSQL source distribution includes examples for notifications >> (examples/demo2a.py, examples/demo2b.py). >> Please report back if you still have problems. > > They are not working under Linux or Windows. I tried examples from > gnumed project as well. 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. -- Gerhard |
From: Karsten H. <Kar...@gm...> - 2003-05-28 13:20:23
|
>> They are not working under Linux or Windows. I tried examples from >> gnumed project as well. I wrote most of the GnuMed code and it certainly works for me. If you run client/python-common/gmPG.py from our CVS you'll be asked if you want to run a PostgreSQL notification debugger shell. You can use one or two of those to test various scenarios or mix in some psql sessions, too. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 |
From: Adam B. <ad...@po...> - 2003-05-28 22:31:40
|
On Wed, May 28, 2003 at 02:18:42PM +0200, Gerhard H=E4ring wrote: > >>The pyPgSQL source distribution includes examples for notifications=20 > >>(examples/demo2a.py, examples/demo2b.py). > >>Please report back if you still have problems. [...] > They did certainly work for me last time I checked. >=20 > Do you have different versions of the PostgreSQL client library and the= =20 > server? If for example you use a 7.3 client and a 7.2 server there migh= t=20 > 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, --=20 Adam Buraczewski <ad...@po...> * 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? |
From: Billy G. A. <bil...@mu...> - 2003-05-29 02:10:31
Attachments:
pgnotify.patch
|
Gerhard H=E4ring wrote: > [Cc-ed to pypgsql-users - I'd recommend to take this discussion over=20 > there] > > Witek wrote: > >> Gerhard H=E4ring wrote: >> >>>> I'm using pypgsql to connect to postgresql database (7.2, 7.3). >>>> I recieve PgNotify object using notifies() method of connection=20 >>>> object, but it's fields values are random chars and wrong process=20 >>>> id. Is there someone, who put it to work? >>> >>> >>> The pyPgSQL source distribution includes examples for notifications=20 >>> (examples/demo2a.py, examples/demo2b.py). >>> Please report back if you still have problems. >> >> >> They are not working under Linux or Windows. I tried examples from=20 >> gnumed project as well. > > > They did certainly work for me last time I checked. > > Do you have different versions of the PostgreSQL client library and=20 > the server? If for example you use a 7.3 client and a 7.2 server there=20 > might be some problems ... Just a rough guess of me of course. > > -- Gerhard It was working the last time I checked, but it's not working now :-( I've update the CVS repository with a fixed pgnotify.c that will correct=20 the problem. I am also attaching a patch file to correct the problem. --=20 _________________________________________________________________________= __ ____ | Billy G. Allie | Domain....: Bil...@mu... | /| | 7436 Hartwell | MSN.......: B_G...@em... |-/-|----- | Dearborn, MI 48126| |/ |LLIE | (313) 582-1540 | |