Re: WIP: Automatic view update rules

From: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
To: "Bernd Helmle" <bernd(at)oopsware(dot)de>
Cc: "Bernd Helmle" <mailings(at)oopsware(dot)de>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: Automatic view update rules
Date: 2008-12-28 21:30:00
Message-ID: 3073cc9b0812281330l1590b515x2b1aecec662630@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Dec 28, 2008 at 9:29 AM, Bernd Helmle <bernd(at)oopsware(dot)de> wrote:
>
> Yes, it seems we have to check for target lists having negative attnums in
> 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 <view definition> syntax
rule 6:
"""
6) If the <query expression> is updatable, then the viewed table is
an updatable table. Otherwise, it is a read-only table.
"""
wich i understand as deny updatability in any view that constains non
updateable <query expression> in the target list

>> 2) Another less important bug, the WITH CHECK OPTION is accepted even
>> when that functionality is not implemented.
>>
>> updatable_views=# 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 <view definition> ) says:
"""
12)If WITH CHECK OPTION is specified, then the viewed table shall
be updatable.

"""

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-28 22:00:58 Re: TODO items for window functions
Previous Message David Rowley 2008-12-28 21:29:24 Re: TODO items for window functions