Re: question on rules

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: weigelt(at)metux(dot)de, PGSQL-SQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: question on rules
Date: 2003-06-13 16:30:27
Message-ID: 3EE9FC23.8020206@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
> weigelt(at)metux(dot)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(at)Yahoo(dot)com #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message chester c young 2003-06-13 19:15:57 Re: create tables within functions
Previous Message Stephan Szabo 2003-06-13 15:22:42 Re: create tables within functions