2

I write a DB LISTENing program something like as shown here (Example 3)==> https://www.postgresql.org/docs/9.1/static/libpq-example.html

I have a problem with pg_notify such that;

NOTIFY channel

==> works fine, C program catches the signal

whereas

SELECT pg_notify('channel','This is a test'); 

==> Program can't catch anything.

Any idea? Note: My Version is PostgreSQL 10.5

2 Answers 2

4

In NOTIFY Channel, 'Channel' is treated as an SQL identifier, and will automatically be transformed to lower case if not surrounded by double quotes, like NOTIFY "Channel". This is usual PostgreSQL behavior. The arguments to pg_notify are strings, not SQL identifiers, so they are case-preserved.

2

I think, I found the solution. If I use lower characters in the channel name, pg_notify and corresponding C program works well, but for the upper case channel name, it doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.