Re: ALTER TABLE ... REPLACE WITH
| От | Robert Haas |
|---|---|
| Тема | Re: ALTER TABLE ... REPLACE WITH |
| Дата | |
| Msg-id | AANLkTimTz9rBACA_y-mT8v_F=6rC1A7UMFvvUxfbT4Zh@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: ALTER TABLE ... REPLACE WITH (Simon Riggs <simon@2ndQuadrant.com>) |
| Список | pgsql-hackers |
On Wed, Dec 15, 2010 at 5:39 AM, Simon Riggs <simon@2ndquadrant.com> wrote: > Perhaps a more useful definition would be > > EXCHANGE TABLE target WITH source; > > which just swaps the heap and indexes of each table. > You can then use TRUNCATE if you want to actually destroy data. > > I will go with that unless we have other objections. I still don't see how that's going to work with foreign keys. If there's a foreign key referencing the old table, there's no way to be sure that all of those references are still going to be valid with respect to the new table without a full-table check. And that seems to defeat the purpose of the feature. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: