Re: [GENERAL] Multiple RULES on Views

2005-04-22 Thread David Wheeler
On Apr 22, 2005, at 2:09 AM, Sebastian Böck wrote: Multiple rules on the same table and same event type are applied in alphabetical name order. Ah, I'd missed that. Curious that it worked for me, then, since my rules were named insert_one, promote_one, and nothing_one, as nothing_one comes after

Re: [GENERAL] Multiple RULES on Views

2005-04-22 Thread =?ISO-8859-1?Q?Sebastian_B=F6ck?=
David Wheeler wrote: [...] Well, I didn't have an unconditional update rule, so I added one without removing the other two: CREATE RULE nothing_one AS ON INSERT TO one DO INSTEAD NOTHING; And it worked! Now I can have an insert do an INSERT or UPDATE on another table magically. But my question

[GENERAL] Multiple RULES on Views

2005-04-21 Thread David Wheeler
Hi All, I recently had a need to have conditional update rules on a view. This didn't work too well: CREATE RULE insert_one AS ON INSERT TO one WHERE NEW.id IS NULL DO INSTEAD ( INSERT INTO _simple (id, guid, state, name, description) VALUES (NEXTVAL('seq_kinetic'), NEW.guid, NEW.state, NEW.n