Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fumNz-0000Nh-6X for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Aug 2018 22:22:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fumNx-0001C2-26 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Aug 2018 22:22:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fumNw-0001Bp-Iq for pgsql-hackers@lists.postgresql.org; Tue, 28 Aug 2018 22:22:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fumNp-0001xC-HJ for pgsql-hackers@lists.postgresql.org; Tue, 28 Aug 2018 22:22:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7SMMh4h010818; Tue, 28 Aug 2018 18:22:43 -0400 From: Tom Lane To: Alvaro Herrera cc: Stephen Frost , pgsql-hackers@lists.postgresql.org Subject: Re: More parallel pg_dump bogosities In-reply-to: <20180828193031.ahilzgnpkug6x45c@alvherre.pgsql> References: <20180828193031.ahilzgnpkug6x45c@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 28 Aug 2018 16:30:31 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10816.1535494963.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Aug 2018 18:22:43 -0400 Message-ID: <10817.1535494963@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2018-Aug-28, Tom Lane wrote: >> Doesn't pg_backup_archiver.c's identify_locking_dependencies() need to >> treat POLICY and ROW SECURITY items as requiring exclusive lock on >> the referenced table? Those commands definitely acquire >> AccessExclusiveLock in a quick test. > I hadn't come across this locking dependency before, so it's pretty > likely that partitioned index attachment has a problem here. Hm, it looks like ALTER INDEX public.at_partitioned_a_idx ATTACH PARTITION public.at_part_1_= a_idx; takes these locks: relation | mode = ----------------------+--------------------- at_part_1 | AccessShareLock at_partitioned | AccessShareLock at_part_1_a_idx | AccessExclusiveLock at_partitioned_a_idx | AccessExclusiveLock I'm not aware of exactly what this does to catalog entries, but is it *really* safe to have only AccessShareLock on the tables? That sounds like a bit of wishful thinking :-(. In any case, the exclusive locks on the indexes are likely sufficient to block other operations on the tables (maybe leading to deadlocks), so I'm inclined to think that yeah, parallel restore should refrain from running this in parallel with other DDL on either table. regards, tom lane