Re: update in rule

From: Radoslaw Stachowiak <radek(at)alter(dot)pl>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: update in rule
Date: 2001-11-07 10:52:49
Message-ID: 20011107115249.V7681@blue.alter.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

*** Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> [Wednesday, 17.October.2001, 12:04 -0700]:
> create function adresses_trigger() returns opaque as '
> begin
> NEW.date_maj := now();
> return NEW;
> end;' language 'plpgsql';
> create trigger tr before update on adresses for each row execute
> procedure adresses_trigger();

why sould I use before (instead of after)?
isnt it a little dangerous in transactions? /hope not/

I know difference between both forms. The question is rather about if
timestamp updating shouldnt be run AFTER update which I think is closer
to a real world situations (of course evth vary). But maybe there are
some probles with after, which I dont know about?

Just being curious...

--
radoslaw.stachowiak.........................................http://alter.pl/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sean K. Sell 2001-11-07 12:43:16 Re: update in rule
Previous Message Nick Sayer 2001-11-07 02:19:27 Problems with user-level security

Browse pgsql-sql by date

  From Date Subject
Next Message Sean K. Sell 2001-11-07 12:43:16 Re: update in rule
Previous Message Janning Vygen 2001-11-07 08:49:43 Re: Design Tool for postgresql