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 1lv1yQ-00023W-RB for pgsql-general@arkaria.postgresql.org; Sun, 20 Jun 2021 18:15:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lv1xu-0006sP-5D for pgsql-general@arkaria.postgresql.org; Sun, 20 Jun 2021 18:14:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv1xt-0006sH-Sd for pgsql-general@lists.postgresql.org; Sun, 20 Jun 2021 18:14:37 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv1xr-000176-VH for pgsql-general@lists.postgresql.org; Sun, 20 Jun 2021 18:14:37 +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 15KIEU0a1513082; Sun, 20 Jun 2021 14:14:30 -0400 From: Tom Lane To: Vijaykumar Jain cc: Karsten Hilbert , pgsql-general Subject: Re: pg_dump/pg_restore vs default_transaction_read_only under PG 13.2 In-reply-to: References: <1511776.1624211267@sss.pgh.pa.us> Comments: In-reply-to Vijaykumar Jain message dated "Sun, 20 Jun 2021 23:33:50 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1513080.1624212870.1@sss.pgh.pa.us> Date: Sun, 20 Jun 2021 14:14:30 -0400 Message-ID: <1513081.1624212870@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Vijaykumar Jain writes: > i have db example which i want to migrate from one version to another. > to do that i disable writes on the db by setting the tx flag, so that i can > be sure it is still serving reads, but no additional data is written. > i can take a pg_dump, the db is still serving the reads. What is the point of that? pg_dump will capture a consistent data snapshot in any case. AFAICS, all you accomplish by disabling writes on the source server is a self-inflicted DOS. (Also, the fact that default_transaction_read_only is so easy to override means it's not that useful as a means of disabling writes.) regards, tom lane