parametrized NOTIFY - issue in plpgsql, maybe ToDo

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: parametrized NOTIFY - issue in plpgsql, maybe ToDo
Date: 2010-03-16 19:23:48
Message-ID: 162867791003161223y52ec7618v417429e91281331@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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
pavel(at)postgres:5432=# select foo('pavel');
foo
-----

(1 row)

Time: 31,732 ms
pavel(at)postgres:5432=# listen xxx;
LISTEN
Time: 0,271 ms
pavel(at)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.
pavel(at)postgres:5432=#

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-16 19:29:02 Re: parametrized NOTIFY - issue in plpgsql, maybe ToDo
Previous Message Gokulakannan Somasundaram 2010-03-16 16:13:24 Re: Bug in 9.0Alpha4