Re: Replacing a table

From: Neil Conway <neilc(at)samurai(dot)com>
To: Francisco Reyes <lists(at)natserv(dot)com>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Replacing a table
Date: 2002-10-30 17:28:31
Message-ID: 87vg3jvnsw.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Francisco Reyes <lists(at)natserv(dot)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(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message s-psql 2002-10-30 17:54:50 Re: permission prob: granted, but still denied
Previous Message Ian Harding 2002-10-30 17:06:40 Re: [SQL] unnecessary updates