Received: from corppo1.uvsg.com (corppo1.uvsg.com [192.40.65.90]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA12863 for ; Fri, 4 Jun 1999 12:24:48 -0400 (EDT) (envelope-from michael.j.davis@tvguide.com) Received: from prevuepo1.uvsg.com ([192.40.65.44]) by corppo1.uvsg.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2448.0) id L4BCTN6V; Fri, 4 Jun 1999 11:24:49 -0500 Received: by prevuepo1.uvsg.com with Internet Mail Service (5.5.2448.0) id ; Fri, 4 Jun 1999 11:27:47 -0500 Message-ID: <93C04F1F5173D211A27900105AA8FCFC145565@lambic.prevuenet.com> From: Michael J Davis To: "'Chris Bitmead'" , pgsql-sql@postgreSQL.org Subject: RE: [SQL] RV: A little problem updating data with views Date: Fri, 4 Jun 1999 11:25:35 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id MAA12879 You can create rules that simulate views and allow you to update the database. I have not done this myself but have heard they work. Rules are more complex that views. The html documentation has a lot of information about rules. Views are implemented in Postgres using rules without the update capabilities. -----Original Message----- From: Chris Bitmead [SMTP:chris.bitmead@bigfoot.com] Sent: Friday, June 04, 1999 7:25 AM To: pgsql-sql@postgreSQL.org Subject: Re: [SQL] RV: A little problem updating data with views I don't believe views are updatable in postgresql. Jorge Herrera Piņero wrote: > > Hello, > > We are using PostgreSQL v6.4 and have problems when we want update > data throught views. > When we issue an update statment within a view, always obtain 'UPDATE 0' > and the data is not updated. We have checked write permissions on view > and are right. > > Any ideas was going wrong? > > thanks in advance. > > A complete UPDATE test: > > test=> create table ttest (t varchar(20), n int4); > test=> create view vtest as select t from ttest; > test=> insert into ttest values('asd', 0); > test=> select * from vtest; > t > --- > asd > (1 row) > > test=> grant all on ttest, vtest to postgres; > CHANGE > > test=> update vtest set t='asdasd'; > UPDATE 0 -- Chris Bitmead http://www.bigfoot.com/~chris.bitmead mailto:chris.bitmead@bigfoot.com