Hello

I am testing NOTIFY statement. It have to be used from plpgsql via
EXECUTE, because doesn't support paramaters.

Can be it documented somewhere?

create or replace function foo(a varchar)
returns void as $$
begin
  execute 'notify xxx, ' || quote_literal(a);
  return;
end;
$$ language plpgsql;
CREATE FUNCTION
Time: 2,513 ms
pa...@postgres:5432=# select foo('pavel');
 foo
-----

(1 row)

Time: 31,732 ms
pa...@postgres:5432=# listen xxx;
LISTEN
Time: 0,271 ms
pa...@postgres:5432=# select foo('pavel');
 foo
-----

(1 row)

Time: 436,058 ms
Asynchronous notification "xxx" with payload "pavel" received from
server process with PID 4730.
pa...@postgres:5432=#

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to