Re: Updatable views

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, Bernd Helmle <mailings(at)oopsware(dot)de>
Subject: Re: Updatable views
Date: 2008-05-08 13:42:50
Message-ID: 1210254170.4268.365.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, 2008-05-08 at 14:56 +0200, Peter Eisentraut wrote:
> Am Donnerstag, 8. Mai 2008 schrieb Simon Riggs:
> > CREATE RULE somename AS ON INSERT TO x WHERE where-clause DO INSERT ...
> >
> > which seems straightforward, no?
>
> Double evaluation is the key word. The conclusion was more or less that you
> can't implement check constraints using the rules system. You need to check
> them in the executor.

That makes sense. I can't see how we would make LOCAL CHECK CONSTRAINTs
work with rules anyhow.

So that means WITH CHECK CONSTRAINT is going to end up executed in a
similar place to constraint evaluation on underlying tables.

That leaves me in a difficult position with MERGE though. MERGE does
something similar with conditional-WHEN clause evaluation, plus
transformation of the sub-statements is only sensible when we have
updatable views. :-(

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-05-08 14:03:39 Re: Bogosity in contrib/xml2/Makefile
Previous Message Simon Riggs 2008-05-08 13:38:30 Re: Internal design of MERGE, with Rules

Browse pgsql-patches by date

  From Date Subject
Next Message Bernd Helmle 2008-05-08 15:20:06 Re: Updatable views
Previous Message Bernd Helmle 2008-05-08 13:24:18 Re: Updatable views