Re: updateable/insertable view having left joined tables

From: Seb <spluque(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: updateable/insertable view having left joined tables
Date: 2009-06-13 00:22:27
Message-ID: 87iqj1t22k.fsf@kolob.sebmags.homelinux.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The following seems to work, but I don't feel confident this is really
the correct code:

CREATE RULE shoe_upd AS
ON UPDATE TO shoe
DO INSTEAD (
UPDATE shoes
SET sh_name = NEW.sh_name, sh_avail = NEW.sh_avail
WHERE shoes.sh_id = NEW.sh_id;
INSERT INTO shoelaces (sh_id, sl_name)
SELECT New.sh_id, New.sl_name WHERE New.sl_name IS NOT NULL;);

I could find out doing a number of tests, but it would be good to
understand what is going on.

--
Seb

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Fenbers 2009-06-13 20:51:20 drop PW
Previous Message Greg Stark 2009-06-12 22:25:19 Re: Taking the cache out of the equation?