Re: Replacing a table

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Replacing a table
Дата
Msg-id 87vg3jvnsw.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответ на Replacing a table  (Francisco Reyes <lists@natserv.com>)
Список pgsql-general
Francisco Reyes <lists@natserv.com> writes:
> I have some report tables which get re-created every day.
> Previously I had something like
> drop table
> select .... into table

> What would be the way to replace tables?

Try creating the summary data in new table with a temporary name, then
starting a transaction, dropping the original table, renaming the new
table to the proper name, and then committing the transaction.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

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

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Replacing a table
Следующее
От: s-psql@rhythm.cx
Дата:
Сообщение: Re: permission prob: granted, but still denied