From: Henry Ortega <juandelacruz@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Trigger on Insert to Update only newly inserted fields?
Date: Mon, 28 Aug 2006 10:02:32 -0400
Message-ID: <2bffcc330608280702y16c25090i816589e20163e7e8@mail.gmail.com> (raw)
I have a On Insert Trigger that updates one of the columns in that same
table.
Is there a way for the trigger to run only for the newly inserted records?
Instead of all records in the database?
E.g.:
ID Start_Date End_Date
001 08-01-2006
002 08-02-2006
On Insert/Update, Update End_Date=now().
I want that to run only on new records.or the updated
record. How can I do this?
Thank you so much.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: juandelacruz@gmail.com
Subject: Re: Trigger on Insert to Update only newly inserted fields?
In-Reply-To: <2bffcc330608280702y16c25090i816589e20163e7e8@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox