Re: Proposal for updatable views

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal for updatable views
Date: 2006-06-16 18:50:38
Message-ID: 200606161850.k5GIocV13194@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


URL added to TODO. I assume there has been no more progress on this patch.

---------------------------------------------------------------------------

Bernd Helmle wrote:
> Hi folks,
>
> Please find attached a patch that implements SQL92-compatible updatable
> views. The patch introduces new semantics into the rule system: implicit
> and explicit rules. Implicit rules are created to implement updatable views:
>
> _INSERT
> _NOTHING_INSERT (unconditional DO INSTEAD NOTHING rule)
> _DELETE
> _NOTHING_DELETE (unconditional DO INSTEAD NOTHING rule)
> _UPDATE
> _NOTHING_UPDATE (unconditional DO INSTEAD NOTHING rule)
>
> These rules are marked 'implicit' in pg_rewrite, the rewriter is teached to
> handle them different, depending on wether they are created with a rule
> condition (a view's CHECK OPTION) or not. The CHECK OPTION itself is
> implemented with a new system function and a conditional rule that
> evaluates the view's WHERE condition (pg_view_update_error()).
>
> The supported syntax is
>
> CREATE VIEW foo AS SELECT ... [WITH [LOCAL | CASCADED] CHECK OPTION];
>
> The LOCAL and CASCADED keywords are optional when a CHECK OPTION is
> specified, the default is CASCADED (this syntax creates a shift/reduce
> conflict in the grammar file i don't know how to fix).
>
> If a user wants his own rules with CREATE RULE to be created, the implicit
> rule gets dropped, depending what action the user selects.
>
> The patch introduces support for pg_dump as well.
>
> Please note that the patch isn't complete yet, but it seems it's necessary
> to discuss its implementation on -hackers now.
>
> Bernd

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Woodward 2006-06-16 18:52:58 Re: Preventing DELETE and UPDATE without a WHERE clause?
Previous Message Bruce Momjian 2006-06-16 18:48:59 Re: [HACKERS] Automatic free space map filling