triggered_change_notification v3

Lists: pgsql-hackers
From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Dimitri Fontaine"<dimitri(at)2ndQuadrant(dot)fr>, <pgsql-hackers(at)postgresql(dot)org>
Subject: triggered_change_notification v3
Date: 2012-01-16 04:05:09
Message-ID: 4F134D95020000250004482B@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Attached is a version of a previously posted patch which has been
modified based on on-list feedback from Álvaro.

This is a generalized trigger function which can be used as an AFTER
EACH ROW trigger on any table which has a primary key, and will send
notifications of operations for which the trigger is attached, with a
payload indicating the table, the operation, and the primary key. A
channel can be specified in the CREATE TRIGGER command, but will
default to "tcn" if omitted.

I had previously submitted this as a core function, but with a mature
extensions feature now present, I reworked it as a contrib extension.
If not accepted into contrib, I can post it to PGXN, but I thought
it seemed a reasonable candidate for contrib.

I took a shot at creating docs similar to other contrib extensions,
but couldn't quite figure out how to get them to build. If someone
can give me pointers on that, I'll polish that up. I find it hard to
work on the docs in sgml without being able to build and review the
html output.

-Kevin

Attachment Content-Type Size
tcn-v3.patch application/octet-stream 10.4 KB

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: triggered_change_notification v3
Date: 2012-01-20 04:16:10
Message-ID: CA+TgmoY6t1vKLzSHn7Ls8VzmYJTdG8Axq2-EhUW002uXWK1GtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Jan 15, 2012 at 11:05 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> Attached is a version of a previously posted patch which has been
> modified based on on-list feedback from Álvaro.
>
> This is a generalized trigger function which can be used as an AFTER
> EACH ROW trigger on any table which has a primary key, and will send
> notifications of operations for which the trigger is attached, with a
> payload indicating the table, the operation, and the primary key. A
> channel can be specified in the CREATE TRIGGER command, but will
> default to "tcn" if omitted.

Nice work, Kevin. I've committed this.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company