From: Christian Storm <christian.storm@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PFC <lists@peufeu.com>
Cc: Jim C. Nasby <jnasby@pervasive.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: pgmemcache
Date: Fri, 14 Apr 2006 11:01:10 -0700
Message-ID: <79637789-3BD1-4450-BD72-C0025225E900@gmail.com> (raw)
In-Reply-To: <2847.1144975434@sss.pgh.pa.us>
References: <1144135482.063425.33380@z34g2000cwc.googlegroups.com>
<20060411225515.GZ49405@pervasive.com>
<op.s7vvyggtcigqcu@apollo13>
<200604121603.43986.josh@agliodbs.com>
<20060413001024.GP49405@pervasive.com>
<6236.1144888514@sss.pgh.pa.us>
<4D23826E-7325-4946-B79A-80E321E0E497@gmail.com>
<26792.1144949880@sss.pgh.pa.us>
<op.s7yqxh1ycigqcu@apollo13>
<2847.1144975434@sss.pgh.pa.us>
> I'll let you in on a secret: NOTIFY is actually a before-commit
> operation. This is good enough because it never, or hardly ever,
> fails. I would argue that anything you want to do in an AFTER COMMIT
> trigger could just as well be done in a BEFORE COMMIT trigger; if
> that's
> not reliable enough then you need to fix your trigger.
So, looping back to pgmemcache. It doesn't seem like it's about the
trigger failing; it's about
the transaction failing. How could I 'fix my trigger' so that if
the transaction fails
the cache wouldn't be updated?
> An AFTER COMMIT trigger would have to be in a separate transaction.
Agreed. Each trigger being in its own transaction.
> What happens if there's more than one, and one of them fails?
Each AFTER COMMIT trigger would be in its own transaction. So if it
fails, let it fail. It isn't the original transactions fault. If
you want it to bundled
with the original transaction then do a BEFORE COMMIT.
If there is more than one, so be it. One may fail, another may not.
If that is not okay or the intended behavior, then create a new
trigger than
combines them into one transaction so that they are coupled.
> Even
> more to the point, if it's a separate transaction, don't you have
> to fire all these triggers again when you commit that transaction?
> The idea seems circular.
Why would it have to do this? Not sure if I follow. In my mind,
the only way this would happen is if the AFTER COMMIT trigger acted
upon the very same table it is triggered off of. Then you could
have a circular reference. However, this is true for the BEFORE COMMIT
situation too. I don't see the difference. What am I missing?
Cheers,
Christian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: christian.storm@gmail.com, tgl@sss.pgh.pa.us, lists@peufeu.com, jnasby@pervasive.com, josh@agliodbs.com
Subject: Re: pgmemcache
In-Reply-To: <79637789-3BD1-4450-BD72-C0025225E900@gmail.com>
References: <1144135482.063425.33380@z34g2000cwc.googlegroups.com> <20060411225515.GZ49405@pervasive.com> <op.s7vvyggtcigqcu@apollo13> <200604121603.43986.josh@agliodbs.com> <20060413001024.GP49405@pervasive.com> <6236.1144888514@sss.pgh.pa.us> <4D23826E-7325-4946-B79A-80E321E0E497@gmail.com> <26792.1144949880@sss.pgh.pa.us> <op.s7yqxh1ycigqcu@apollo13> <2847.1144975434@sss.pgh.pa.us> <79637789-3BD1-4450-BD72-C0025225E900@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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