On Sun, 2006-10-15 at 18:16 -0400, Tom Lane wrote:
> Rafal Pietrak <[EMAIL PROTECTED]> writes:
> > Hmm. I tried that, But I'm stuck with finding a way to propagate the
> > 'intermediate data' between BEFORE/AFTER triggers, *outside* of a TABLE
> > structure. That data is easily accesable inside the
Rafal Pietrak <[EMAIL PROTECTED]> writes:
> Hmm. I tried that, But I'm stuck with finding a way to propagate the
> 'intermediate data' between BEFORE/AFTER triggers, *outside* of a TABLE
> structure. That data is easily accesable inside the BEFORE TRIGGER as
> simple variable.
Um ... what data do
On Sun, 2006-10-15 at 15:15 -0400, Tom Lane wrote:
> Well, of course not: it's a BEFORE trigger, so the row insertion hasn't
> actually happened yet. I think you need to split this operation into a
> BEFORE trigger that changes the ID, and an AFTER trigger that propagates
> the data into the other
Rafal Pietrak <[EMAIL PROTECTED]> writes:
> CREATE TABLE master (id int not null unique, info text, );
> CREATE TABLE aux (master int references master(id), info text, ...);
> CREATE FUNCTION adjust() RETURNS "trigger" AS $$ BEGIN
> new.id := 1000-old.id;
> INSERT INTO aux (master
On Sun, 2006-10-15 at 20:01 +0200, Rafal Pietrak wrote:
> new.id := 1000-old.id;
Sory, correction.
Of cource, this ID update looks more like the following (OLD.* isn't
valid at this point):
new.id := 1000 - new.id;
--
-R
---(end of broadcast)--
Hi,
I'm trying to write a trigger function, that would update an
'associated' TEBLE on INSERT to master table:
CREATE TABLE master (id int not null unique, info text, );
CREATE TABLE aux (master int references master(id), info text, ...);
CREATE FUNCTION adjust() RETURNS "trigger" AS $$ BEGIN