pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedNOTIFY man page still recommends rules
4+ messages / 3 participants
[nested] [flat]
* NOTIFY man page still recommends rules
@ 2016-08-02 17:23 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 1 reply; 4+ messages in thread
From: Peter Eisentraut @ 2016-08-02 17:23 UTC (permalink / raw)
To: pgsql-docs
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-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: NOTIFY man page still recommends rules
@ 2016-08-02 17:31 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 2 replies; 4+ messages in thread
From: Alvaro Herrera @ 2016-08-02 17:31 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-docs
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/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: NOTIFY man page still recommends rules
@ 2016-08-02 17:34 Tom Lane <tgl@sss.pgh.pa.us>
parent: Alvaro Herrera <alvherre@2ndquadrant.com>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2016-08-02 17:34 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-docs
Alvaro Herrera <alvherre@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
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: NOTIFY man page still recommends rules
@ 2016-08-03 16:33 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Alvaro Herrera <alvherre@2ndquadrant.com>
1 sibling, 0 replies; 4+ messages in thread
From: Peter Eisentraut @ 2016-08-03 16:33 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-docs
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
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2016-08-03 16:33 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 17:23 NOTIFY man page still recommends rules Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2016-08-02 17:31 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-08-02 17:34 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-08-03 16:33 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox