LISTEN/NOTIFY Test - Mailing list pgsql-testers

From Josh Berkus
Subject LISTEN/NOTIFY Test
Date
Msg-id 4B8415A2.2070704@agliodbs.com
Whole thread Raw
List pgsql-testers
[TEST REPORT]

[Release]: 9.0 Alpha 4

[Test Type]: Feature Test

[Test]: LISTEN/NOTIFY

[Platform]: OSX 10.5 Intel 32-bit compile

[Parameters]: --with-perl

[Failure]: No.

[Results]: Was able to LISTEN to notifications sent by trigger.

[Comments]: Created a pgbench database.  Added a NOTIFY trigger to
pgbench_history to send notifications of new rows with a payload of tid.
 Set up local listener which received notifications.

create or replace function notify_new_history ()
returns trigger
language plpgsql
as $f$
BEGIN

PERFORM pg_notify('new_history',NEW.tid::TEXT);

return NEW;
END; $f$;

create trigger new_history AFTER INSERT OR UPDATE ON pgbench_history
for each row execute procedure notify_new_history();

pgsql-testers by date:

Previous
From: Josh Berkus
Date:
Subject: Streaming Replication Test
Next
From: Mario Splivalo
Date:
Subject: Postgres 9.0alpha4?