Skip site navigation (1) Skip section navigation (2)

insert rows into view

From: Ivan Horvath <pillesoft(at)yahoo(dot)co(dot)uk>
To: pgsql-new <pgsql-novice(at)postgresql(dot)org>
Subject: insert rows into view
Date: 2002-03-07 12:53:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
how can i insert/update/delete a row into a view?
i read in the manual that i have to use a rule for the
table, but for me it is not working.

here are the codes for the view, and the rule:
DROP VIEW plant_unit_view;
CREATE VIEW plant_unit_view AS SELECT * FROM

DROP RULE plant_unit_rule;
CREATE RULE plant_unit_rule AS
    ON INSERT TO plant_unit
        DO INSTEAD INSERT INTO plant_unit
            (pu_code, pu_name, unit_id, pu_type,
job_id, mod_user, mod_date)
            (new.pu_code, new.pu_name, new.unit_id,
new.pu_type, new.job_id, new.mod_user, new.mod_date);


Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!


pgsql-novice by date

Next:From: daqDate: 2002-03-07 13:07:00
Subject: Re: insert rows into view
Previous:From: Yannick ALLUSSEDate: 2002-03-07 07:56:49
Subject: Size of the empty database

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group