Re: varattno remapping - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: varattno remapping
Date
Msg-id 52BAA3FB.2000206@2ndquadrant.com
Whole thread Raw
In response to Re: varattno remapping  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On 12/24/2013 11:17 PM, Dean Rasheed wrote:
> I don't think this bit is quite right.
> 
> It's not correct to assume that all the view columns are simple
> references to columns of the base relation --- auto-updatable views
> may now contain a mix of updatable and non-updatable columns, so some
> of the view columns may be arbitrary expressions.

Ah - it looks like I'd checked against 9.3 and missed the relaxation of
those requirements.

> There is already code in rewriteTargetView() that does something very
> similar (to the whole parsetree, rather than just the returning list)
> with 2 function calls:

Copying the view tlist and then adjusting it is a much smarter way to do
it. I should've seen that the pull-up code could be adapted to deal with
the RETURNING list, so thankyou.

It's a cleaner way to do it.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Re: Fix typo in src/backend/utils/mmgr/README
Next
From: "MauMau"
Date:
Subject: Re: [bug fix] "pg_ctl stop" times out when it should respond quickly