Re: [SQL] question on rules

2003-06-16 Thread Tomasz Myrta
Dnia 2003-06-13 03:26, Uz.ytkownik [EMAIL PROTECTED] napisa?: hi folks, i'd like to write an rule which fills out some empty attrs on insert (w/ data from other given attrs). the table structure is: CREATE TABLE foo (start date, duration integer, endtime date); and the rule is: CREATE RULE foo1

Re: [SQL] question on rules

2003-06-13 Thread Jan Wieck
Tom Lane wrote: [EMAIL PROTECTED] 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 in

Re: [SQL] question on rules

2003-06-12 Thread Tom Lane
[EMAIL PROTECTED] 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. regards, tom lane ---(end of broadcast)--

[SQL] question on rules

2003-06-12 Thread weigelt
hi folks, i'd like to write an rule which fills out some empty attrs on insert (w/ data from other given attrs). the table structure is: CREATE TABLE foo (start date, duration integer, endtime date); and the rule is: CREATE RULE foo1 AS ON INSERT TO foo WHERE new.endtime = NULL DO INSERT