Re: ALTER TABLE ... REPLACE WITH

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: ALTER TABLE ... REPLACE WITH
Дата
Msg-id 4D07C6B8.4070200@agliodbs.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE ... REPLACE WITH  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: ALTER TABLE ... REPLACE WITH  (Robert Haas <robertmhaas@gmail.com>)
Re: ALTER TABLE ... REPLACE WITH  (Simon Riggs <simon@2ndQuadrant.com>)
Re: ALTER TABLE ... REPLACE WITH  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 12/14/10 11:07 AM, Robert Haas wrote:
> Because then you have to take an AccessExclusiveLock on the target
> table, of course.

Well, you have to do that for DROP TABLE as well, and I don't see any
way around doing it for REPLACE WITH.

As for the utility of this command: there is no question that I would
use it.  I'm not sure I like the syntax (I'd prefer REPLACE TABLE ____
WITH _____), but that's painting the bike shed.  While the command may
appear frivolous and unnecessary syntactical ornamentation to some, I
have to say that doing the "table doesy-doe" which this command
addresses is something I have written scripts for on at least 50% of my
professional clients.  It keeps coming up.

In order for REPLACE WITH to be really useful, though, we need a command
cloning at table design with *all* constraints, FKs, keys, and indexes.Currently, I still don't think we have that ...
dowe?
 

--                                  -- Josh Berkus                                    PostgreSQL Experts Inc.
                        http://www.pgexperts.com
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Triggered assertion "!(tp.t_data->t_infomask & HEAP_XMAX_INVALID)" in heap_delete() on HEAD [PATCH]
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: ALTER TABLE ... REPLACE WITH