trigger AFTER INSERT - Mailing list pgsql-admin

From Josi Perez (3T Systems)
Subject trigger AFTER INSERT
Date
Msg-id AANLkTinpHpBZQ09BHXhsUoJCwsw4up=yC=n=zJshavnm@mail.gmail.com
Whole thread Raw
Responses Re: trigger AFTER INSERT  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
Hi,

I think that I have a conceptual problem and I hope anyone could help me.

If I write a trigger AFTER INSERT and I have one error in this trigger, the record (that I think was already inserted) is not inserted.
Example:

INSERT INTO tableX <record1>
trigger sumRecords AFTER INSERT under tableX to accumulate the records inserted by hour
if there is an error in the commands executed for this record, <record1> is not in the tableX

If this occurs in a trigger BEFORE INSERT, I can understand, but, if it is AFTER INSERT, I believe that the record is already inserted.
What is wrong on it?

Thanks in advance
Josi Perez
#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}

pgsql-admin by date:

Previous
From: "Tomeh, Husam"
Date:
Subject: High-water Mark for number of sessions/connections reached in Postgres
Next
From: Tom Lane
Date:
Subject: Re: trigger AFTER INSERT