Re: Replacing a table - Mailing list pgsql-general

From Neil Conway
Subject Re: Replacing a table
Date
Msg-id 87vg3jvnsw.fsf@mailbox.samurai.com
Whole thread Raw
In response to Replacing a table  (Francisco Reyes <lists@natserv.com>)
List 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 by date:

Previous
From: Francisco Reyes
Date:
Subject: Replacing a table
Next
From: s-psql@rhythm.cx
Date:
Subject: Re: permission prob: granted, but still denied