Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2461F64FD5E for ; Sun, 28 Dec 2008 17:30:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 77762-01 for ; Sun, 28 Dec 2008 17:30:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f19.google.com (mail-gx0-f19.google.com [209.85.217.19]) by mail.postgresql.org (Postfix) with ESMTP id 716AA64FD6D for ; Sun, 28 Dec 2008 17:30:02 -0400 (AST) Received: by gxk12 with SMTP id 12so3130159gxk.19 for ; Sun, 28 Dec 2008 13:30:01 -0800 (PST) Received: by 10.150.228.12 with SMTP id a12mr19782885ybh.241.1230499800845; Sun, 28 Dec 2008 13:30:00 -0800 (PST) Received: by 10.151.44.6 with HTTP; Sun, 28 Dec 2008 13:30:00 -0800 (PST) Message-ID: <3073cc9b0812281330l1590b515x2b1aecec662630@mail.gmail.com> Date: Sun, 28 Dec 2008 16:30:00 -0500 From: "Jaime Casanova" To: "Bernd Helmle" Subject: Re: WIP: Automatic view update rules Cc: "Bernd Helmle" , "Robert Haas" , pgsql-hackers@postgresql.org In-Reply-To: <61043.91.48.33.48.1230474598.squirrel@tooney.at.xencon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <2849137C693B65CC8E86411C@imhotep.credativ.de> <94CF655A8D0DC7D5B4B81D8B@imhotep.credativ.de> <603c8f070811112006q906b3a6o59a66228b7fc997@mail.gmail.com> <7F84532C73CB3279DE8436E0@imhotep.credativ.de> <603c8f070811131344n5c087057p11f94780dae80885@mail.gmail.com> <603c8f070811252043r75db3e83v2eba1611452ee62e@mail.gmail.com> <3073cc9b0812250943x23547116ud956d8ab111e55bf@mail.gmail.com> <61043.91.48.33.48.1230474598.squirrel@tooney.at.xencon.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/1853 X-Sequence-Number: 130482 On Sun, Dec 28, 2008 at 9:29 AM, Bernd Helmle wrote: > > Yes, it seems we have to check for target lists having negative attnums i= n > checkTree(). Another solution would be to simply ignore those columns > (extract them from the target list and include all updatable columns > only). > i would say check for negative attnums and deny that view to be updateable because of SQL92 says in 11.19 syntax rule 6: """ 6) If the is updatable, then the viewed table i= s an updatable table. Otherwise, it is a read-only table. """ wich i understand as deny updatability in any view that constains non updateable in the target list >> 2) Another less important bug, the WITH CHECK OPTION is accepted even >> when that functionality is not implemented. >> >> updatable_views=3D# create or replace view v2 as select * from foo where >> id < 10 with check option; >> NOTICE: CREATE VIEW will create implicit INSERT/UPDATE/DELETE rules >> CREATE VIEW >> > > What do we want in this case? We can throw an error telling that CHECK > OPTION isn't supported yet or simply issueing a warning. > yes. if we didn't do that we will be against spec. syntax rule 12 (again in 11.19 ) says: """ 12)If WITH CHECK OPTION is specified, then the viewed table shall be updatable. """ --=20 Atentamente, Jaime Casanova Soporte y capacitaci=F3n de PostgreSQL Asesor=EDa y desarrollo de sistemas Guayaquil - Ecuador Cel. +59387171157