X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7DB7A9F9FE3 for ; Mon, 19 Jun 2006 17:03:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 89698-02 for ; Mon, 19 Jun 2006 17:02:50 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from wx-out-0102.google.com (wx-out-0102.google.com [66.249.82.197]) by postgresql.org (Postfix) with ESMTP id 39AB39F9998 for ; Mon, 19 Jun 2006 17:02:49 -0300 (ADT) Received: by wx-out-0102.google.com with SMTP id h30so923626wxd for ; Mon, 19 Jun 2006 13:02:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=abW/PditQDG6vmm8KmmbFVo1hqcUSbgDUwwAWHCyTS0kn/itXjlF31RfIz8lCfa7OUJselqtM4Km941jmyElXvb5T+paX6++nGKwAHN7WfqkvqoSXfw8m1eH5/N6NE53AcIeEeGLDKsl8m/vZLG9c8OmMuI/TcPtfXoDQgu3YM8= Received: by 10.70.100.8 with SMTP id x8mr9121364wxb; Mon, 19 Jun 2006 13:02:48 -0700 (PDT) Received: by 10.70.66.15 with HTTP; Mon, 19 Jun 2006 13:02:48 -0700 (PDT) Message-ID: Date: Mon, 19 Jun 2006 15:02:48 -0500 From: "Aaron Bono" To: "Tom Lane" Subject: Re: truncate partitioned table locking Cc: "Sriram Dandapani" , pgsql-admin@postgresql.org In-Reply-To: <20384.1150741590@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_101876_29864707.1150747368642" References: <6992E470F12A444BB787B5C937B9D4DF04C4CDCB@ca-mail1.cis.local> <20384.1150741590@sss.pgh.pa.us> X-Google-Sender-Auth: a304a9793f36ecbd X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/152 X-Sequence-Number: 22114 ------=_Part_101876_29864707.1150747368642 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I am curious, why would a query on a parent table, A, put a lock on a child table, B? If the query doesn't touch B or any of its children, why would PostgreSQL care what happens to the child table during its query? -Aaron On 6/19/06, Tom Lane wrote: > > "Sriram Dandapani" 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 ------=_Part_101876_29864707.1150747368642 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I am curious, why would a query on a parent table, A, put a lock on a child table, B?  If the query doesn't touch B or any of its children, why would PostgreSQL care what happens to the child table during its query?

-Aaron

On 6/19/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Sriram Dandapani" <sdandapani@counterpane.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
------=_Part_101876_29864707.1150747368642--