Libpq docs say connections should not be shared between threads.
Some example error messages:
message type 0x31 arrived from server while idle
message type 0x32 arrived from server while idle
message type 0x54 arrived from server while idle
PostgreSQL Error: Unknown
Also, the sleep(1) poll loop makes this useless for most things. It should use a select call because most of the time people are using notify for timely notification.
Libpq docs say connections should not be shared between threads.
Some example error messages: message type 0x31 arrived from server while idle message type 0x32 arrived from server while idle message type 0x54 arrived from server while idle PostgreSQL Error: Unknown
Also, the sleep(1) poll loop makes this useless for most things. It should use a select call because most of the time people are using notify for timely notification.