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

From Tom Lane
Subject Re: ALTER TABLE ... REPLACE WITH
Date
Msg-id 23306.1295565585@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE ... REPLACE WITH  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jan 20, 2011 at 4:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> If you're willing to substitute an incompatible table, it's not clear
>> why you don't just do
>> 
>>                begin;
>>                drop table t;
>>                alter table t_new rename to t;
>>                commit;

> Because the whole source of this problem is dependency hell.

Well, if you want to preserve dependencies, you can *not* just blindly
substitute an incompatible table.  You must ensure that views and
foreign keys referencing the table are still valid.  So I'm not sure
where anybody got the idea that an implementation that fails to check
all that is even worth presenting.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: ALTER TABLE ... REPLACE WITH
Next
From: "Kevin Grittner"
Date:
Subject: Re: SSI and Hot Standby