Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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();

pgsql-testers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group