Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-25 Thread Nico Williams
I guess this got lost over the weekend and subsequent week (I was on vacation). On Fri, Sep 15, 2017 at 04:03:35PM -0500, Nico Williams wrote: > On Fri, Sep 15, 2017 at 04:07:33PM -0400, Tom Lane wrote: > > Nico Williams writes: > > > On Fri, Sep 15, 2017 at 02:19:29PM -0500, Nico Williams wrote

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Nico Williams
On Fri, Sep 15, 2017 at 04:07:33PM -0400, Tom Lane wrote: > Nico Williams writes: > > On Fri, Sep 15, 2017 at 02:19:29PM -0500, Nico Williams wrote: > >> On Fri, Sep 15, 2017 at 11:26:08AM -0700, Andres Freund wrote: > >>> I think you should also explain why that's a desirable set of > >>> semanti

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Tom Lane
Nico Williams writes: > On Fri, Sep 15, 2017 at 02:19:29PM -0500, Nico Williams wrote: >> On Fri, Sep 15, 2017 at 11:26:08AM -0700, Andres Freund wrote: >>> I think you should also explain why that's a desirable set of >>> semantics. > Now, why is this desirable: atomicity. >The client/user

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Nico Williams
On Fri, Sep 15, 2017 at 12:25:08PM -0700, Andres Freund wrote: > On 2017-09-15 14:19:29 -0500, Nico Williams wrote: > > Please see my post and the linked file to see why. > > The discussions here are often going to be referred back to in years, so > external links where we aren't sure about the lo

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Nico Williams
On Fri, Sep 15, 2017 at 02:19:29PM -0500, Nico Williams wrote: > On Fri, Sep 15, 2017 at 11:26:08AM -0700, Andres Freund wrote: > > I think you should also explain why that's a desirable set of > > semantics. Note that DEFERRED CONSTRAINT TRIGGERs already have these semantics, except of course tha

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Andres Freund
Hi, On 2017-09-15 14:19:29 -0500, Nico Williams wrote: > Please see my post and the linked file to see why. The discussions here are often going to be referred back to in years, so external links where we aren't sure about the longevity (like e.g. links to the mailing list archive, where we're fa

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Nico Williams
On Fri, Sep 15, 2017 at 11:26:08AM -0700, Andres Freund wrote: > On 2017-09-14 14:41:12 -0500, Nico Williams wrote: > > I've read through several old threads on COMMIT TRIGGERs. Rather than > > write a lengthy post addressing past debates, here's an implementation > > and demonstration of [an appr

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Andres Freund
Hi, On 2017-09-14 14:41:12 -0500, Nico Williams wrote: > I've read through several old threads on COMMIT TRIGGERs. Rather than > write a lengthy post addressing past debates, here's an implementation > and demonstration of [an approximation of] COMMIT TRIGGERs with natural > and _desirable_ seman

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Nico Williams
On Fri, Sep 15, 2017 at 4:11 AM Alexander Korotkov < a.korot...@postgrespro.ru> wrote: > On Thu, Sep 14, 2017 at 10:41 PM, Nico Williams > wrote: > >> https://github.com/twosigma/postgresql-contrib/ >> >> https://github.com/twosigma/postgresql-contrib/blob/master/commit_trigger.sql >> >> https://

Re: [HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-15 Thread Alexander Korotkov
On Thu, Sep 14, 2017 at 10:41 PM, Nico Williams wrote: > https://github.com/twosigma/postgresql-contrib/ > https://github.com/twosigma/postgresql-contrib/blob/ > master/commit_trigger.sql > https://raw.githubusercontent.com/twosigma/postgresql- > contrib/master/commit_trigger.sql Do I understan

[HACKERS] COMMIT TRIGGERs, take n, implemented with CONSTRAINT TRIGGERS

2017-09-14 Thread Nico Williams
I've read through several old threads on COMMIT TRIGGERs. Rather than write a lengthy post addressing past debates, here's an implementation and demonstration of [an approximation of] COMMIT TRIGGERs with natural and _desirable_ semantics: - commit triggers run exactly once in any write transact