Re: truncate partitioned table locking

From: "Sriram Dandapani" <sdandapani(at)counterpane(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: truncate partitioned table locking
Date: 2006-06-19 18:41:05
Message-ID: 6992E470F12A444BB787B5C937B9D4DF04C4CDFB@ca-mail1.cis.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I have a situation where data is constantly inserted and frequently
queried into a master table(and routed appropriately to the partition
based on a non-overlapping check constraint ). I also need to drop the
child partition (say for yesterday's data..the partitioning is done on a
daily basis).

How can I issue a truncate /drop table on the child without running into
locking issues. Doesn't constraint exclusion prevent access of a child
table based on the check constraint criteria

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, June 19, 2006 11:27 AM
To: Sriram Dandapani
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] truncate partitioned table locking

"Sriram Dandapani" <sdandapani(at)counterpane(dot)com> writes:
> I have master table A, inherited by Table B and Table C

> Does the truncation of a child table take a lock on the master table ?

No, but it certainly locks the child table ... and queries on A are
going to try to scan all three tables.

regards, tom lane

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Benjamin Krajmalnik 2006-06-19 19:45:41 Re: truncate partitioned table locking
Previous Message Tom Lane 2006-06-19 18:26:30 Re: truncate partitioned table locking