postgresql - How to execute PERFORM pg_notify('', '')? -


when execute perform pg_notify('channel', 'payload'); following error:

error:  syntax error @ or near "perform" line 1: perform pg_notify('channel', 'payload');         ^ 

what doing wrong?

the select counterpart works, i'm looking no-result equivalent. , i'm using psql (9.5.3, server 9.5.0).

the problem here relies on fact perform can not executed directly within prompt. documentation says:

sometimes useful evaluate expression or select query discard result, example when calling function has side-effects no useful result value. in pl/pgsql, use perform statement:

it's little bit tricky perform can used in pl/pgsql context (functions, stored procedures , stuff). , trying execute directly in prompt not supported.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -