Statement level trigger clarification

From: "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Statement level trigger clarification
Date: 2008-09-15 06:03:01
Message-ID: b0a3bf780809142303s469b9baav680e1a586f2ffa51@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm new to triggers and I'm having difficulty in understanding how
statement level triggers on before updates work.

I have a function that sets new.last_modified := current_timestamp;

If I were to define a trigger as:-

CREATE TRIGGER my_trigger
BEFORE INSERT OR UPDATE
ON my_table
FOR EACH STATEMENT
EXECUTE PROCEDURE my_function();

and my update statement were to update more than one row, would I be
correct in understanding that every row the update statement touches
will have the exact same value for last_modified?

Chris
--
Chris Velevitch
Manager - Adobe Platform Users Group, Sydney
m: 0415 469 095
www.apugs.org.au

Adobe Platform Users Group, Sydney
September meeting: It's Going To Be Brilliant
Date: Mon 29th September 6pm for 6:30 start
Details and RSVP on http://apugs2008september.eventbrite.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tomasz Ostrowski 2008-09-15 06:37:28 Re: Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )
Previous Message Martin Langhoff 2008-09-15 05:32:50 Re: Pg 8.3 tuning recommendations for embedded low-memory device (for OLPC :-) )