Re: NEW in after insert trugger contained incorrect data

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: brilliantov(at)byterg(dot)ru
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: NEW in after insert trugger contained incorrect data
Date: 2014-11-14 15:27:40
Message-ID: 54661F6C.4050100@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/14/2014 07:23 AM, Brilliantov Kirill Vladimirovich wrote:
> Adrian Klaver wrote on 11/14/2014 05:15 PM:
>>
>> Actually I think there is in the table the trigger is on. From the
>> original post:
>>
>> SQL statement "INSERT INTO trassa.cpu_load (device, device_timestamp,
>> cpu, value) VALUES(5,'1970-01-02 06:02:38',0,6),(5,'1970-01-02
>> 06:02:38',1,0),(5,'1970-01-02 06:02:38',255,3)"
>>
>> though what is showing up in the error is this:
>>
>>
>> NOTICE: *** START ***: (9994,5,"2014-11-14 13:38:04.94","1970-01-02
>> 06:02:38",0 ,6)
>
> You can see what original data contained timestamp 1970-01-02 06:02:38,
> value 0 and 6, trigger start message also contain this values.
> Base on this I think trigger start message is correct and I get it after
> first insert, where 9994 is a inserted id.

But the error message is coming from this:

PL/pgSQL function
update_cpu_load_list(integer,integer,smallint[],smallint[]) line 19 at
EXECUTE statement

Note different function name and the EXECUTE statement. There is no
EXECUTE in the function you showed us.

>>
>> Not sure where the 9994, and "2014-11-14 13:38:04.94" are coming from,
>> though I think it is related to this from the error message:
>>
>> PL/pgSQL function
>> update_cpu_load_list(integer,integer,smallint[],smallint[]) line 19 at
>> EXECUTE statement
>>
>> I am pretty sure the error is coming from a different function then the
>> one we are being shown. So we would need to see the table the trigger is
>> being run on as well as any other triggers and associated functions.
>>
>>>
>>> Yours,
>>> Laurenz Albe
>>>
>>
>>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brilliantov Kirill Vladimirovich 2014-11-14 15:32:31 Re: NEW in after insert trugger contained incorrect data
Previous Message Brilliantov Kirill Vladimirovich 2014-11-14 15:23:56 Re: NEW in after insert trugger contained incorrect data