Re: pl/pgsql question - Mailing list pgsql-sql

From Tim Perdue
Subject Re: pl/pgsql question
Date
Msg-id 3E008003.1030402@perdue.net
Whole thread Raw
In response to Re: pl/pgsql question  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
Responses Re: pl/pgsql question  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
Ludwig Lim wrote:

>   Try changing the "AFTER" to "BEFORE"
> 
> CREATE TRIGGER projtask_insert_depend_trig BEFORE...
> 
> Changes made to the "NEW" will not be reflect in the
> AFTER trigger since, the row is already inserted.

Thanks, however this seems to present a different problem now.
        FOR dependon IN SELECT * FROM project_depend_vw                                WHERE 
project_task_id=NEW.project_task_id LOOP


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.

Tim



pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: Dynamic sql program using libpq
Next
From: dnaren@hss.hns.com
Date:
Subject: Error code for database down