Search Postgresql Archives
Trying to understand odd trigger behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Trying to understand odd trigger behavior
- From: Bruno Wolff III <bruno@xxxxxxxx>
- Date: Thu, 14 Jun 2018 23:04:24 -0500
- Mail-followup-to: Bruno Wolff III <bruno@xxxxxxxx>, pgsql-general@xxxxxxxxxxxxxx
- User-agent: Mutt/1.10.0 (2018-05-17)
I think I know what is happening, but I wanted to see if my understanding
is correct.
I have a perl after insert trigger for a table with a non-null column element
and I am getting an occasional error when the trigger executes for
printing a null value which is $TD->{new}{element}. However, I do the
insert with an on conflict that converts it into an update. And I have
a before update trigger that blocks changing the record, but returns null
if the old and new records are the same.
My theory is that the insert trigger is firing even though the action
got changed to an update and that because the update trigger cancelled
the update, there is no new record. So I should just test for $TD->{new}
being doing before doing stuff.
Does that sound correct?
[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]