pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@peufeu.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Storm <christian.storm@gmail.com>
Cc: Jim C. Nasby <jnasby@pervasive.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: pgmemcache
Date: Thu, 13 Apr 2006 22:23:31 +0200
Message-ID: <op.s7yqxh1ycigqcu@apollo13> (raw)
In-Reply-To: <26792.1144949880@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>


> An AFTER COMMIT trigger would have to be in a separate transaction.

	I guess AFTER COMMIT triggers would be like a NOTIFY, but more powerful.  
While NOTIFY can't transmit information to another process, this trigger  
could, and the other process could then view the results of the commited  
transaction.
	Also, implementing a long process (something involving network  
roundtrips, for instance) in a BEFORE COMMIT trigger would delay the  
transaction and any locks it holds with no benefit.

> What happens if there's more than one, and one of them fails?

	Each one in its own transaction ?

> 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.

	I guess AFTER COMMIT triggers are most useful when coupled to a trigger  
on a modification to a table. So, the "before / after commit" could be an  
attribute of an AFTER INSERT/UPDATE/DELETE trigger. If the AFTER COMMIT  
trigger doesn't do any modifications to the target table, there will be no  
infinite loop.

	The before/after commit could also be implemented not via triggers, but  
via deferred actions, by telling postgres to execute a specific query just  
before/after the transaction commits. This could be used to implement the  
triggers, but would also be more generic : a trigger on INSERT could then  
defer a call to memcache update once the transaction is commited. It gets  
lisp-ish, but it would be really cool?



view thread (14+ messages)  latest in thread

Message-ID: <op.s7yqxh1ycigqcu@apollo13>
Permalink:  ../op.s7yqxh1ycigqcu@apollo13/
Also on:    postgresql.org/message-id/op.s7yqxh1ycigqcu@apollo13

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: lists@peufeu.com, tgl@sss.pgh.pa.us, christian.storm@gmail.com, jnasby@pervasive.com, josh@agliodbs.com
  Subject: Re: pgmemcache
  In-Reply-To: <op.s7yqxh1ycigqcu@apollo13>

* 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