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
Post a Comment