Re: NEW in after insert trugger contained incorrect data - Mailing list pgsql-general

From Albe Laurenz
Subject Re: NEW in after insert trugger contained incorrect data
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17D9E49D@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to NEW in after insert trugger contained incorrect data  (Brilliantov Kirill Vladimirovich <brilliantov@byterg.ru>)
Responses Re: NEW in after insert trugger contained incorrect data
Re: NEW in after insert trugger contained incorrect data
List pgsql-general
Brilliantov Kirill Vladimirovich wrote:
> I use Postgre-9.3.5 on windows7 x64.
> I use simple trigger for store some statistic data, it code:
> SELECT field IN variable FROM table WHERE ...;
> IF FOUND THEN
>    UPDATE table SET field = ...;
> ELSE
>    INSERT INTO table (field) VALUES(value);
> END IF;
> RETURN NULL;
> 
> This trigger added as FOR EACH ROW on table2.
> In table2 I insert multiple data on one insert, e.g. INSERT INTO
> table2(field) VALUES(value0),(value1),(value2).
> 
> Unfortunately trigger exit with error: ERROR:  record "new" has no field
> "value";

You should post the table definition and the whole trigger; the error
message seems to refer to things you omitted in your quote.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: Two instances of Postgres with single data directory
Next
From: Brilliantov Kirill Vladimirovich
Date:
Subject: Re: NEW in after insert trugger contained incorrect data