Re: question on rules - Mailing list pgsql-sql

From Jan Wieck
Subject Re: question on rules
Date
Msg-id 3EE9FC23.8020206@Yahoo.com
Whole thread Raw
In response to question on rules  (weigelt@metux.de)
List pgsql-sql
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 #



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: create tables within functions
Next
From: chester c young
Date:
Subject: Re: create tables within functions