Re: Allowing COPY into views - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Allowing COPY into views
Date
Msg-id 87ejmgez4s.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Allowing COPY into views  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
"Alvaro Herrera" <alvherre@commandprompt.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



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Fragmentation project
Next
From: Tom Lane
Date:
Subject: Re: pgsql crollable cursor doesn't support one form of postgresql's cursors