Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tksXv-007YsZ-3B for pgsql-admin@arkaria.postgresql.org; Wed, 19 Feb 2025 22:27:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tksXs-00Eb3A-RI for pgsql-admin@arkaria.postgresql.org; Wed, 19 Feb 2025 22:27:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tksXs-00EazY-FH for pgsql-admin@lists.postgresql.org; Wed, 19 Feb 2025 22:27:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tksXq-001n87-2o for pgsql-admin@lists.postgresql.org; Wed, 19 Feb 2025 22:27:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51JMRjWm2583156; Wed, 19 Feb 2025 17:27:45 -0500 From: Tom Lane To: "David G. Johnston" cc: Siraj G , Scott Ribe , Pgsql-admin Subject: Re: Does export operation cancel SQLs? In-reply-to: References: <098b7dbed4aa52c97b6159b26c36129ff2f10409.camel@cybertec.at> Comments: In-reply-to "David G. Johnston" message dated "Wed, 19 Feb 2025 15:20:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2583154.1740004065.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 19 Feb 2025 17:27:45 -0500 Message-ID: <2583155.1740004065@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Wed, Feb 19, 2025 at 1:57 PM Siraj G wrote: >> But I wonder if pg_dump does acquire locks? > Everything acquires locks (basically). It is the specific nature of the > locks held and requested that matter. For more color on that see https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES particularly the table of lock mode conflicts. pg_dump generally takes ACCESS SHARE locks on the tables it plans to dump, which is the same lock level taken by a plain SELECT. That will only block ACCESS EXCLUSIVE locks, which by and large are only taken by major DDL operations. regards, tom lane