From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject:
Date: 2013-07-12 11:23:40
Message-ID: CAHjZ2x7AMebB4dVoW9FWRb3NQde-_zwbP5eAphJ=-3ZAD8+VMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all
I'm making some experiments with table archiving and I'd like to
"replace" a full table F with an empty one E.
In order to do this I see only one way:

ALTER TABLE F RENAME TO T;
ALTER TABLE E RENAME TO F;
ALTER TABLE T RENAME TO E; -- optional

This implies there's a moment when the full table doesn't exist.
Would a transaction enclosure ensure that the table F will be always
available to all clients?
Thanks.

--
Vincenzo Romano - NotOrAnd.IT
Information Technologies
--
NON QVIETIS MARIBVS NAVTA PERITVS

Responses

Browse pgsql-general by date

  From Date Subject
Next Message shankar.kotamarthy@gmail.com 2013-07-12 11:56:23 pg_upgrade could not create catalog dump while upgrading from 9.0 to 9.2
Previous Message hubert depesz lubaczewski 2013-07-12 11:05:36 Re: How can you get "WAL segment has already been removed" when doing synchronous replication ?!