Received: from mail.alter.pl (blue.alter.pl [212.244.165.40]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fA7Aqxm97674 for ; Wed, 7 Nov 2001 05:53:05 -0500 (EST) (envelope-from radek@alter.pl) Received: by mail.alter.pl (Postfix, from userid 500) id B4EE45B07B; Wed, 7 Nov 2001 11:52:49 +0100 (CET) Date: Wed, 7 Nov 2001 11:52:49 +0100 From: Radoslaw Stachowiak To: pgsql-admin@postgresql.org Subject: Re: update in rule Message-ID: <20011107115249.V7681@blue.alter.pl> Mail-Followup-To: pgsql-admin@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Archive-Number: 200111/22 X-Sequence-Number: 2547 *** Stephan Szabo [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/