Re: ALTER TABLE ... REPLACE WITH

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: ALTER TABLE ... REPLACE WITH
Дата
Msg-id 4D07C6EC.2030200@enterprisedb.com
обсуждение исходный текст
Ответ на ALTER TABLE ... REPLACE WITH  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: ALTER TABLE ... REPLACE WITH  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 14.12.2010 20:27, Simon Riggs wrote:
> There are various applications where we want to completely replace the
> contents of a table with new/re-calculated data.
>
> It seems fairly obvious to be able to do this like...
> 1. Prepare new data into "new_table" and build indexes
> 2. Swap old for new
> BEGIN;
> DROP TABLE "old_table";
> ALTER TABLE "new_table" RENAME to "old_table";
> COMMIT;
>
> Step (2) works, but any people queuing to access the table will see
>    ERROR:  could not open relation with OID xxxxx

Could we make that work without error?

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: ALTER TABLE ... REPLACE WITH
Следующее
От: Robert Haas
Дата:
Сообщение: Re: ALTER TABLE ... REPLACE WITH