Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[DOCS] NOTIFY man page still recommends rules

1 view
Skip to first unread message

Peter Eisentraut

unread,
Aug 2, 2016, 1:23:56 PM8/2/16
to
The NOTIFY man page writes

When <command>NOTIFY</command> is used to signal the occurrence of
changes
to a particular table, a useful programming technique is to put the
<command>NOTIFY</command> in a rule that is triggered by table updates.

Is using rules here still best practice? This was probably written
before statement triggers were available.

Even if yes, we might want to explain why, since we generally discourage
rule use otherwise.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


--
Sent via pgsql-docs mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

Alvaro Herrera

unread,
Aug 2, 2016, 1:31:54 PM8/2/16
to
Peter Eisentraut wrote:
> The NOTIFY man page writes
>
> When <command>NOTIFY</command> is used to signal the occurrence of
> changes
> to a particular table, a useful programming technique is to put the
> <command>NOTIFY</command> in a rule that is triggered by table updates.
>
> Is using rules here still best practice? This was probably written
> before statement triggers were available.
>
> Even if yes, we might want to explain why, since we generally discourage
> rule use otherwise.

I think it's easier to dodge the rules topic entirely here and just
mention statement triggers. Using rules you cannot cover the truncate
case, for instance.

--
Álvaro Herrera http://www.2ndQuadrant.com/

Tom Lane

unread,
Aug 2, 2016, 1:34:31 PM8/2/16
to
Alvaro Herrera <alvh...@2ndquadrant.com> writes:
> Peter Eisentraut wrote:
>> Is using rules here still best practice? This was probably written
>> before statement triggers were available.

> I think it's easier to dodge the rules topic entirely here and just
> mention statement triggers. Using rules you cannot cover the truncate
> case, for instance.

+1

regards, tom lane

Peter Eisentraut

unread,
Aug 3, 2016, 12:34:19 PM8/3/16
to
On 8/2/16 1:31 PM, Alvaro Herrera wrote:
> I think it's easier to dodge the rules topic entirely here and just
> mention statement triggers. Using rules you cannot cover the truncate
> case, for instance.

done

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


0 new messages