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 1lv1XR-0001Hs-UG for pgsql-general@arkaria.postgresql.org; Sun, 20 Jun 2021 17:47:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lv1XQ-0002Kv-U0 for pgsql-general@arkaria.postgresql.org; Sun, 20 Jun 2021 17:47:16 +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 1lv1XQ-0002Im-KE for pgsql-general@lists.postgresql.org; Sun, 20 Jun 2021 17:47:16 +0000 Received: from mout.gmx.net ([212.227.15.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv1XO-0000UJ-5I for pgsql-general@lists.postgresql.org; Sun, 20 Jun 2021 17:47:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624211231; bh=SqJXUeR9PJ3b4etQ365jjd5mbdNTTIDCk3eXWURFX2M=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=i+8WNZ30fTf5/rL507b442mUxe/MtumvnKOuX1Oc3t0xja9EydmeddLmegTbMTkQg M4sapAulLcqbG+nsPREjqFPRJi7Jhpno0ez/YjpdAfOCxMldAI3CRtr6xrvyOBM4Yb whgSx68psh0wGIA2+mb30ivwm+jRL0zw6QHm9ieA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([78.55.9.221]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MvK0R-1l41LL2bHV-00rJNv; Sun, 20 Jun 2021 19:47:11 +0200 Received: from ncq by hermes with local (Exim 4.94.2) (envelope-from ) id 1lv1XJ-0002w3-HS; Sun, 20 Jun 2021 19:47:09 +0200 Date: Sun, 20 Jun 2021 19:47:09 +0200 From: Karsten Hilbert To: Vijaykumar Jain Cc: pgsql-general Subject: Re: pg_dump/pg_restore vs default_transaction_read_only under PG 13.2 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:qdgVOVnOyOHxQ+YnqUVlBnBtUbX4hWwNLmAx5cxAGjhKpzSoEpw 9hSys6N4LJce4wzYNui3eYpoIro+xBPpbsOcRpbWn9Aa4t/RlD3h70xGObx1ZTDB3zPzufH YJOikX0gVGWqE9BCKu33dhq7a35Pd1WJt7rhPWOki9CNOUYp24wdUgKqsAnKbpO9ggXoT2g gwz087A+c4fvkP/N7tsWA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:3xeVaW7Rv2w=:kgpfDavUOvFIqx6V6/vEgU icY36+yqJ41FwyGkYZiUiW8MXMypS4kZYv23YOh5JOMQ3Q+kKcOp0JhlLxBZmiDhzSb/Lzylv 2o9yBV4fymK6L2Pfe2AvSMQZLbrE8fZcObQ4o2vMz7EONnBqxU77OmmoRk25+5FyPTcLSlPqZ 4dfgHafBaCSEyvxSpvr7FzzuEccHWuiRggduce10rMXMkoP7Biuf+1YSGjG7wU+pDoXrOhtqD 7CqCtFksnpcMQWhu39G+86+iUiHBPgqU/OOePfUBNVCDzsXdoUGlVhjrM++a33AU/z5QUINcA njwdYjgoXYn3kMb9U2RsFs66let34uPYuqGa7iqeMyf66itf7Kq6yrvkOCXE+SJw7ohB2q23G wX23u3QpcPI8VH4T1zD8ZYc8hIrFhlgDiCwgSSFOmB0a6j4p9Ew2mWxZoYegEFK6oUJwoqWyw vX8CacTLwHw5ALOejaHC3FxvcmPcJQomlX/p4Q+AjyDNiBh6XbHsO8lOhOohwJ4SThMvMNZTD k2FgspWrZkQDrdYUQIo5O2hMMwv0c0ChuxpIMKQiapgbtJ5Qv+abpBeo7BHXAU6PzFnS5LgSh Yl/6K8WnfwQObYuHj3TQmhZHcHXnVSvTkxBUc+hiWEsQrFn+36BSTp6IQQEUmkh3bj+v02jxc rKW5f5dg6n3Ykb4kY63xguZODK/x4FnfXjs/0lTxMsnC2RZrbx/0E+eyQB9+M3pkxfKECvWRX pl6BySe2OAs64zX0FqWCslU4Oul4AOkVbYrC6XK5CKFE6zgORmrz7381EOyJ6jbSEqzat9mfK rqKjOnz4VUDDKqmlLTrlyNe2cyiV2RGKOW0RNvlezGfSaAgP7PQDd0mEJesfU1PtoMrOD9935 bhB7ME3Bh8IeCsbQjIrpM8IYhU6/dMva5F1TnhTVv3AVvffa1il4NBN7DZ24U557RWMo+XOM+ 7ckLjxwZwcmS3YzckD7jJe01D3BLy9eCm3HgdNQ0PZM8KVJGsONu9WlNFDYduJJsKcY5CS/k6 /ZDmG2oQDMIrKfCeFPa0X0sMI+jyYZ5V8d9h2o+pD1eF9F8RG0Ain2MpEvrzA5FIW6kEEhrrB JrQjFF88QLmKhBLk0BLpXsKWrT4pQ0lZxdx/DA1hEQW1/H6PLa7vMCuOQ== Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dear Jain, > Did I simulate your concern correctly ? Nearly so, to my understanding. What you did (and thanks for the followup) was ... > postgres@db:~/playground/logical_replication$ rm -rf example > postgres@db:~/playground/logical_replication$ initdb -D example 2>/dev/n= ull > >/dev/null > postgres@db:~/playground/logical_replication$ vim example/postgresql.con= f > postgres@db:~/playground/logical_replication$ printf > "default_transaction_read_only=3Don\n" >> example/postgresql.conf #glob= al > config setting as on ... to tell the server to *treat* all databases in the cluster as readonly. IOW, an intent rather than a property of _a_ database (ALTER DATABASE ...). Consequently, ... > postgres@db:~/playground/logical_replication$ pg_ctl -D example -l logfi= le > start > waiting for server to start.... done > server started > postgres@db:~/playground/logical_replication$ psql > psql (14beta1) > Type "help" for help. > > postgres=3D# show default_transaction_read_only; -- validate it is on > default_transaction_read_only > ------------------------------- > on > (1 row) > > postgres=3D# \q > postgres@db:~/playground/logical_replication$ pg_dumpall -f dump.sql ... when the properties get dumped ... > postgres@db:~/playground/logical_replication$ grep > default_transaction_read_only dump.sql -- check what gets dumped > SET default_transaction_read_only =3D off; ... the dump does not contain the "on" setting (because, I assume, it does not dump configuration of the server, but content and properties of databases). Still, thanks for thinking along. Best, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B