pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Perdue <tim@perdue.net>
To: Josh Berkus <josh@agliodbs.com>
Cc: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: pl/pgsql question
Date: Wed, 18 Dec 2002 10:44:46 -0600
Message-ID: <3E00A5FE.7080300@perdue.net> (raw)
In-Reply-To: <web-2290387@davinci.ethosmedia.com>
References: <web-2290387@davinci.ethosmedia.com>

Josh Berkus wrote:
> Tim,
> 
> 
>>That loop apparently does not find any matching rows, which would
>>have been inserted just before this row was, inside the same
>>transaction.
>>
>>It was successfully finding those rows before, when the trigger was
>>AFTER INSERT. If I manually select those rows after the query is
>>committed, I am able to pull up the matching rows.
> 
> 
> I think that triggers are probably not a good strategy for the kind of
> calculation you're doing.  I'd suggest instead a middleware module or a
> "data push" function which would bundle all of the calculation logic
> before calling any of the inserts.

Yeah, but this is so much cooler. ;-)

Essentially this would be like recursion to push back/pull forward tasks 
which are dependent on each other. The "UPDATE" trigger I wrote is about 
5x longer.

I guess I can push this back into the PHP code and do a recusive 
function call, but that seems less sexy.

Tim





view thread (15+ messages)  latest in thread

Message-ID: <3E00A5FE.7080300@perdue.net>
Permalink:  ../3E00A5FE.7080300@perdue.net/
Also on:    postgresql.org/message-id/3E00A5FE.7080300@perdue.net

 · 

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-sql@postgresql.org
  Cc: tim@perdue.net, josh@agliodbs.com
  Subject: Re: pl/pgsql question
  In-Reply-To: <3E00A5FE.7080300@perdue.net>

* 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