Search Postgresql Archives

Re: NEW in after insert trugger contained incorrect data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux