LISTEN/NOTIFY Test

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-testers(at)postgresql(dot)org
Subject: LISTEN/NOTIFY Test
Date: 2010-02-23 17:51:30
Message-ID: 4B8415A2.2070704@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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();

Browse pgsql-testers by date

  From Date Subject
Next Message Mario Splivalo 2010-02-24 08:38:45 Postgres 9.0alpha4?
Previous Message Josh Berkus 2010-02-23 17:50:54 Streaming Replication Test