Re: ALTER TABLE ... REPLACE WITH - Mailing list pgsql-hackers

From Robert Haas
Subject Re: ALTER TABLE ... REPLACE WITH
Date
Msg-id AANLkTi=Kd9yj+NChfwGXZ1X+pt4Xg0Q=8P8Bj7YuXORr@mail.gmail.com
Whole thread Raw
In response to Re: ALTER TABLE ... REPLACE WITH  (Noah Misch <noah@leadboat.com>)
Responses Make relation_openrv atomic wrt DDL  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Thu, Jan 20, 2011 at 6:19 PM, Noah Misch <noah@leadboat.com> wrote:
> On Thu, Jan 20, 2011 at 09:36:11PM +0000, Simon Riggs wrote:
>> I agree that the DDL behaviour is wrong and should be fixed. Thank you
>> for championing that alternative view.
>>
>> Swapping based upon names only works and is very flexible, much more so
>> than EXCHANGE could be.
>>
>> A separate utility might be worth it, but the feature set of that should
>> be defined in terms of correctly-working DDL behaviour. It's possible
>> that no further requirement exists. I remove my own patch from
>> consideration for this release.
>>
>> I'll review your patch and commit it, problems or objections excepted. I
>> haven't looked at it in any detail.
>
> Thanks.  I wouldn't be very surprised if that patch is even the wrong way to
> achieve these semantics, but it's great that we're on the same page as to which
> semantics they are.

I think Noah's patch is a not a good idea, because it will result in
calling RangeVarGetRelid twice even in the overwhelmingly common case
where no relevant invalidation occurs.  That'll add several syscache
lookups per table to very common operations.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: ALTER TABLE ... REPLACE WITH
Next
From: Robert Haas
Date:
Subject: Re: REVIEW: EXPLAIN and nfiltered