On Fri, August 4, 2006 18:33, Aleksey Kontsevich wrote:

Hello,

> I wrote a simple application to test how pqxx::trigger class works and to
> test
> PostgreSQL NOTIFY to use such construction in my further application. But
> this application do not work: I do not see the desired message on NOTIFY
> event. What I am doing wrong? The testlibpq2.c expamle from PostgreSQL
> documentation works fine. The pqxx documentation do not contain any
> example
> on trigger class.

The programs in the "test" directory contain working examples of all
libpqxx functions.  You can find the trigger class in test/test004.cxx
(it's also used in tests 23, 78, 79, and 87).

I think the problem with your test is that you don't call any libpqxx
functions while you wait for notification, so there is no way for the
library to deliver the notifications to your trigger!  Call the
connection's get_notifs() periodically, or even simpler: instead of
writing your own pause function, just use the connection's
await_notification() functions.


Jeroen


_______________________________________________
Libpqxx-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/libpqxx-general

Reply via email to