Re:

From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2013-07-14 18:36:16
Message-ID: CAHjZ2x4zvjx4MhGmbi8i1wdBUqcqx5ANPD8wsszb5Hv5CT5OQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/7/14 Luca Ferrari <fluca1978(at)infinito(dot)it>:
> On Fri, Jul 12, 2013 at 1:23 PM, Vincenzo Romano
> <vincenzo(dot)romano(at)notorand(dot)it> wrote:
>> 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?
>
>
> If I get it right using transaction boundaries around the DDL will
> prevent clients to query the F table until the transaction ends, and
> this is due to the locking of the alter table. In other words, a query
> performed against the F table while the transaction is running will
> simply locks without generating any error.
>
> Hope this helps.
> Luca

Thank Luca. That sheds more light on DDL transactions.
The one I'm thinking of is the body of a PL/PGSQL function.
I am only concerned about how late is done the binding between a table
name and the actual OID for other functions, views and triggers.
Any idea?

Grazie.

In response to

  • Re: at 2013-07-14 16:58:24 from Luca Ferrari

Responses

  • Re: at 2013-07-15 06:13:25 from Luca Ferrari

Browse pgsql-general by date

  From Date Subject
Next Message BladeOfLight16 2013-07-14 19:25:44 Re: Update big table
Previous Message Luca Ferrari 2013-07-14 16:58:24 Re: