Re: Trigger behaviour not as stated

2018-01-31 Thread Bruce Momjian
On Sun, Jan 28, 2018 at 06:17:19PM -0500, Bruce Momjian wrote: > On Sun, Jan 28, 2018 at 06:12:01PM -0500, Tom Lane wrote: > > Bruce Momjian writes: > > > Oh, I am sorry. I was focused on the first part of the sentence and > > > didn't notice your change to the second part. How is this attachmen

Re: Trigger behaviour not as stated

2018-01-29 Thread Bruce Momjian
On Mon, Jan 29, 2018 at 11:32:34AM +, Ian R. Campbell wrote: > The second part of the confusion is that INSERT is not considered to be a row > modification and will fire a BEFORE INSERT trigger on the parent table even > when the data goes into a child (whereas UPDATE and DELETE will not fire a

Re: Trigger behaviour not as stated

2018-01-29 Thread Ian R. Campbell
The original confusion on this is answered in part by the following statement (taken from the answer to my SO question): "UPDATEs and DELETEs on the parent table will affect rows in the child tables (if you don't specify ONLY), but triggers will only be fired by data modifications directed directl

Re: Trigger behaviour not as stated

2018-01-28 Thread Bruce Momjian
On Sun, Jan 28, 2018 at 06:12:01PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Oh, I am sorry. I was focused on the first part of the sentence and > > didn't notice your change to the second part. How is this attachment? > > Seems same as your previous version? OK, new vesion that uses

Re: Trigger behaviour not as stated

2018-01-28 Thread Tom Lane
Bruce Momjian writes: > Oh, I am sorry. I was focused on the first part of the sentence and > didn't notice your change to the second part. How is this attachment? Seems same as your previous version? regards, tom lane

Re: Trigger behaviour not as stated

2018-01-28 Thread Bruce Momjian
On Sun, Jan 28, 2018 at 03:57:07PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Uh, I don't think we want to highlight the statement vs row difference > > here but the fact that statement triggers fire on the referenced object > > and not on the effected rows. I have attached an updated pat

Re: Trigger behaviour not as stated

2018-01-28 Thread Tom Lane
Bruce Momjian writes: > Uh, I don't think we want to highlight the statement vs row difference > here but the fact that statement triggers fire on the referenced object > and not on the effected rows. I have attached an updated patch which I > think is an improvement statement-level trigger

Re: Trigger behaviour not as stated

2018-01-28 Thread Bruce Momjian
On Sun, Jan 28, 2018 at 02:18:38PM -0500, Tom Lane wrote: > Thomas Munro writes: > > On Thu, Jan 25, 2018 at 11:07 AM, Bruce Momjian wrote: > >> ... The attached patch updates the docs to say > >> statement-level triggers fire on the "referenced" table, while row-level > >> triggers fire only on

Re: Trigger behaviour not as stated

2018-01-28 Thread Tom Lane
Thomas Munro writes: > On Thu, Jan 25, 2018 at 11:07 AM, Bruce Momjian wrote: >> ... The attached patch updates the docs to say >> statement-level triggers fire on the "referenced" table, while row-level >> triggers fire only on the "affected" table, (vs. all affected tables) >> even if they are

Re: Trigger behaviour not as stated

2018-01-28 Thread Thomas Munro
On Thu, Jan 25, 2018 at 11:07 AM, Bruce Momjian wrote: > On Wed, Jan 24, 2018 at 01:10:08PM -0500, Bruce Momjian wrote: >> On Wed, Nov 29, 2017 at 07:39:34PM +, i...@thepathcentral.com wrote: >> > The following documentation comment has been logged on the website: >> > >> > Page: https://www.p

Re: Trigger behaviour not as stated

2018-01-24 Thread Bruce Momjian
On Wed, Jan 24, 2018 at 01:10:08PM -0500, Bruce Momjian wrote: > On Wed, Nov 29, 2017 at 07:39:34PM +, i...@thepathcentral.com wrote: > > The following documentation comment has been logged on the website: > > > > Page: https://www.postgresql.org/docs/10/static/sql-createtrigger.html > > Descr

Re: Trigger behaviour not as stated

2018-01-24 Thread Bruce Momjian
On Wed, Nov 29, 2017 at 07:39:34PM +, i...@thepathcentral.com wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/10/static/sql-createtrigger.html > Description: > > URL: https://www.postgresql.org/docs/current/static/sql-crea

Trigger behaviour not as stated

2017-11-29 Thread ian
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/10/static/sql-createtrigger.html Description: URL: https://www.postgresql.org/docs/current/static/sql-createtrigger.html Statement: "In contrast, row-level triggers are fired for all affecte