pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radoslaw Stachowiak <radek@alter.pl>
To: pgsql-admin@postgresql.org
Subject: Re: update in rule
Date: Wed, 7 Nov 2001 11:52:49 +0100
Message-ID: <20011107115249.V7681@blue.alter.pl> (raw)
In-Reply-To: <Pine.BSF.4.21.0110171159030.23020-100000@megazone23.bigpanda.com>
References: <vqobsj6qiw5.fsf@brevent.imag.fr>
	<Pine.BSF.4.21.0110171159030.23020-100000@megazone23.bigpanda.com>

*** Stephan Szabo <sszabo@megazone23.bigpanda.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/



view thread (8+ messages)  latest in thread

Message-ID: <20011107115249.V7681@blue.alter.pl>
Permalink:  ../20011107115249.V7681@blue.alter.pl/
Also on:    postgresql.org/message-id/20011107115249.V7681@blue.alter.pl

 · 

reply

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: radek@alter.pl, pgsql-admin@postgresql.org
  Subject: Re: update in rule
  In-Reply-To: <20011107115249.V7681@blue.alter.pl>

* 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