Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvdHi-00085n-7d for pgsql-admin@arkaria.postgresql.org; Fri, 10 Dec 2021 10:37:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mvdHh-0007qt-4X for pgsql-admin@arkaria.postgresql.org; Fri, 10 Dec 2021 10:37:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvdHg-0007qk-PP for pgsql-admin@lists.postgresql.org; Fri, 10 Dec 2021 10:37:48 +0000 Received: from mout.gmx.net ([212.227.15.15]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvdHd-000352-UQ for pgsql-admin@lists.postgresql.org; Fri, 10 Dec 2021 10:37:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1639132663; bh=srvxM+UhbSjcyyqshxB2aBjyyq9RQamOqEb+FHr03ZY=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=YzcEUrcwIZK60X6F8bOUIsfbdFYC9aTdyV3xsmETbP9XTvqIrxBuuJM91xhTPjvUa Ni6u2GORmnrzC12pT3y9pL0WyoZJ4fGQT5UmmMSUKGJw4ibXpuy9tBi1wcDVmrCjJT LZFF1hODy9u+9MW9HPq86wNAOCK0Pq5ZLFJ4+Rbo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.1.32.250] ([185.40.248.10]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNswE-1nB6nX26YK-00OFJw for ; Fri, 10 Dec 2021 11:37:43 +0100 Subject: Re: Locking in Inheritance partition To: pgsql-admin@lists.postgresql.org References: From: Thomas Kellerer Message-ID: <396391e4-e36a-d51d-2ef1-1e454fd4d6fa@gmx.net> Date: Fri, 10 Dec 2021 11:37:42 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:92KZQffZypWLD/g1zMPyc7c29ROXlUOR1HxBRSUIjXqQOxb3Mqo At943BqGz5MNfAaScaIIWJahdgw67cvIClf9/H1AOca89i6iZIqDcKxVd+fQqpFV0u66NoA bzAfYIaaSXBvIBjhlMaGXrNL0qgc0YVtoz5cqh1F73C13S0CbFgAjjzA4P0koU1tob48H1b 37uGp0IXdGppCQgZiwbZA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:yfuzMq07lSY=:Hcl6OmX5zqBzcW63HrrD/p eHvMZyZV8KUkpcHTvKcyvlYrNeZeCoHPimAuYDKgTKjrjl7qG22f9LwDoGbrgKrgidmnLjgsz FUtTgBzSqSA+Lg0DqPfgXoemkpQ4p7qabejLoJekjQvDLSmDbMG7ATTMGmUxD3/O6hudTyVVq ICd8TlSMlVnIavX4xHFzB5I7f79tjt9RMxey1m6ORoC6OjoO+pxQSukJF1BYj6twJ7uphhris YEbtzXUWxuTlTNWjAZSxuT0t5H7NVzYhbpZ12P5KKPYWJCScof+vjl6wto0I/NkrEHqYRcDE7 Z/TehXARi2ywK8xSES5PfdzZ7g72ddMxf6dExolXCeFu/iWhjaGkZOOkkzSMG203Wqmr83Yvo UGM+H2bJHernY4FHdxLse/eVYgJmpacR+u0tTxDYO9lEKcLl7tBdzwMDwgAj4TnF5MB/GOAfx DzabPVBjacTnF24+eGCvFF7VhX767O5EHsU/eUdX2+ctAFHWMykM3wZAhUfF+YV9q89H7RHa8 IjrwZ63HqIbHjfVZsUgopV+B5EDTXRnfIXwTvYqnQnLxzf+v9CS5hgUHrErXj7zdzsxjjNnYA KPzUm/+6BmpC0NR+vuHoyfi+LSvghhOgxyFpNn0Xa/II1ytr++V5h6UgIS0cx4sSGsvbPjjg+ PlBYnggLiclCM8x1j/oBWiBmCXJmsG34xwoEqmjZ1ba5X7NhRr3ya4lyxLvKEYJNDW69CdLUW 5arJXS2j2cO94Otl9PGZaTzDjTpWvVnfdxM/FmAC4juF/Sg0xPFcF9919op/QCMNO1Ap6+BuH U2untgwc4Lt3uHmSJUFBrLH5PyG9ubhKbrHek1qxSl7CsuQCpaR9W+WIv6Mv4QbaNvbfsdpCp Z30SQaWSNqgjEhJG7/G9Rc8FD89iUVf9Vf4/Dd9l58oJid4Q9Qd79G07JcVpgZ0vEh566w5v+ U07NXlWdhIwdWfEJkevxTU3eOuO63UKg6FZIMah/jYyjTDspt5zOU1o8avOtFZa41GU4VNSTa iuyv2Eajcf3V2i8hZ0BDKKn1/qz0wn1PMWkHiIZuDw+SNyy9S6sNQgI7CKLsmTMxieKghWLAz 7xEbhgPujaeQs0= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Gaurav Anand schrieb am 10.12.2021 um 07:35: > We have a declarative partition on tables in our database which is > PG10. We face issues as the table becomes locked during attach and > detach and cannot be used during the event. > > We have a master and slave setup and application query points to > Slave but whenever we perform attach and detach of partitions on > Master the locks propagates to slave and causes Application to spin. > > Kindly suggest if Inheritance partition will help here or any other > way I can avoid this lock. I don't think inheritance would change the locks this requires. A better solution might be to upgrade to 14 where both attach and detach are non-blocking. Postgres 12 introduced non-blocking attach and Postgres 14 introduced non-blocking detach Thomas