Re: Updatable views

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Updatable views
Date: 2008-05-08 12:28:14
Message-ID: 1210249694.4268.326.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, 2008-05-08 at 13:48 +0200, Bernd Helmle wrote:
> --On Mittwoch, Mai 07, 2008 20:38:59 +0100 Simon Riggs
> <simon(at)2ndquadrant(dot)com> wrote:
>
> >> Where are we on this feature?
> >
> > Any update, Bernd?
>
> I've merged the patch into current -HEAD and updated some parts. My current
> *working* state can be reviewed at
>
> <http://git.postgresql.org/?p=~psoo/postgresql.git;a=shortlog;h=updatable_views>
>
> I'm still not sure how to implement a reliable CHECK OPTION, but short on
> time i haven't done a very deep investigation yet. Next idea was to look at
> the updatable cursor stuff, maybe something there can be reused.

Your earlier patch seemed to add two rules if the view had a with check
option? One with a pass through and another one with a do-nothing and a
where clause.

As I understand it

CREATE VIEW x AS SELECT * FROM foo WHERE where-clause WITH CHECK OPTION

should generate an INSERT rule like this

CREATE RULE somename AS ON INSERT TO x WHERE where-clause DO INSERT ...

which seems straightforward, no?

The SQLStandard default is CASCADED and it seems easier not to worry too
much about the LOCAL option until we have the basics working. I'm not
even sure that we *want* the LOCAL option anyway having read what it
means, plus it isn't supported by many other DBMS.

Do you store anything in the catalog to mark the view as updatable or
not? I couldn't see that but it seemed easier than trying to resolve all
of the updatability characteristics at run-time.

I may be able to help some with the patch, if you'd like?

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2008-05-08 12:56:57 Re: Updatable views
Previous Message Bernd Helmle 2008-05-08 11:48:01 Re: Updatable views

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2008-05-08 12:56:57 Re: Updatable views
Previous Message Bernd Helmle 2008-05-08 11:48:01 Re: Updatable views