From: Jan Wieck <JanWieck@Yahoo.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: weigelt@metux.de, PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: question on rules
Date: Fri, 13 Jun 2003 12:30:27 -0400
Message-ID: <3EE9FC23.8020206@Yahoo.com> (raw)
References: <20030613012611.GA25276@metux.de>
<22503.1055469445@sss.pgh.pa.us>
Tom Lane wrote:
> weigelt@metux.de writes:
>> i'd like to write an rule which fills out some empty attrs on
>> insert (w/ data from other given attrs).
>
> You'd be better off doing this with a BEFORE INSERT trigger.
The only way to do it with rules would be to create a view over the
basetable, create an insert rule over the view and then have the
application doing the insert into the view instead. So "better" could be
considered an understatement :-)
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
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: JanWieck@Yahoo.com, tgl@sss.pgh.pa.us
Subject: Re: question on rules
In-Reply-To: <3EE9FC23.8020206@Yahoo.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