Re: Allowing COPY into views

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allowing COPY into views
Date: 2007-04-19 23:13:39
Message-ID: 87ejmgez4s.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"Alvaro Herrera" <alvherre(at)commandprompt(dot)com> writes:

> What ideas?

Basically I think what we should do is extend SQL to support things like

UPDATE (subquery) SET ...
DELETE FROM (subquery) WHERE ...

Ie, do the update-able view magic in the planner and executor rather than in
the rewriter. Then the rewriter just has the same work to do that it does for
SELECTs, namely substitute the view in the right place in the query. We don't
have the rewriter try to reverse-engineer SELECTS and flatten the view into
the outer query, it shouldn't be trying to do that for UPDATEs and DELETEs
either.

Oracle does actually support syntax like this, even for joins, and it's
awfully convenient for UPDATE where it handles the same kind of cases we use
our UPDATE ... FROM syntax.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-20 05:15:28 Re: pgsql crollable cursor doesn't support one form of postgresql's cursors
Previous Message Heikki Linnakangas 2007-04-19 23:12:15 Re: Fragmentation project