Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eq1ww-0008T5-4K for pgsql-general@arkaria.postgresql.org; Sun, 25 Feb 2018 19:27:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eq1wv-0000Sw-2G for pgsql-general@arkaria.postgresql.org; Sun, 25 Feb 2018 19:27:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eq1Zg-0000nh-Hz for pgsql-general@lists.postgresql.org; Sun, 25 Feb 2018 19:03:04 +0000 Received: from mout.gmx.net ([212.227.17.22]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eq1Zd-0003Cg-VZ for pgsql-general@postgresql.org; Sun, 25 Feb 2018 19:03:03 +0000 Received: from hermes ([84.165.100.165]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MbrR4-1f8FRi03Tq-00JL9T for ; Sun, 25 Feb 2018 20:03:00 +0100 Received: from ncq by hermes with local (Exim 4.90_1) (envelope-from ) id 1eq1Za-0003KH-BX for pgsql-general@postgresql.org; Sun, 25 Feb 2018 20:02:58 +0100 Resent-From: Karsten Hilbert Resent-Date: Sun, 25 Feb 2018 20:02:58 +0100 Resent-Message-ID: <20180225190258.GH1932@hermes.hilbert.loc> Resent-To: pgsql-general Date: Sun, 25 Feb 2018 18:28:27 +0100 From: Karsten Hilbert To: pgsql-announce@lists.postgresql.org Subject: Re: == PostgreSQL Weekly News - January 28 2018 == Message-ID: <20180225172827.GD1932@hermes.hilbert.loc> References: <20180129025748.GA5084@fetter.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180129025748.GA5084@fetter.org> 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) User-Agent: Mutt/1.9.3 (2018-01-21) Sender: X-Provags-ID: V03:K0:4UyQ6C7LYb/+V97dCA8nk7sT9OBp1/n1oQKrYPLXDWSC3uG3AGK ooR+e7UtFGezuaNjaDq5+rr/FGrptPLup128coJVCOP9n+5toNr1RH9CBZCmrM8HaIhhAts vKxRhBU8cLVTxCQdZigxG4/dTVrD5sBdH35BUvHsnefHC1KHK+Jffz1u6lkt05ODhWEHLT/ QQoNynnHfZyICnAwEe3tQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ySvJ8VwFNFw=:Mz5vSb+mn4OoDzyjge9BeY FwXX9Rnr7KplUUauA7TXZ2r4B4V7Xx/jP+jdSt1T5BVUKz/L5KaQJBYQ1Rhzq4b+aYR5Ri4VO EnC5s1Q1KaGItF1wc6gtW14fxlYD1A+123GBP3yhtmNIMzNDLa2X0HBj6S8mwToeYedJGlnSE eaNj8VempKJXnqvtg2FERVL1GNJ8jMk4F6tCjESJMltPXbLi3JetEVw0/YpW9VFAcAze5m/LG tD+PrvbXv7YDPxQa3hbRo+77uNA7kQFYJo5RWsfZTR74EZS+UTHDQlC4YM4jwV/gXSqzQr8bP EXUGdPCDiDMJO7AAHXIASmvInv3graVrK0nsZ1EiVMyxb8noQWaB1i9+W0WM+fSUQUzaSBJOU IkYF+zZ8r0tD2OGE57VJvXApgvOI7mudpCilg3M07ysS1oLFraNr81rlTh7DvqN1ApMe6IWYc kMrud5PeXFpHMwoPBRYzADUIobpYJF/4JS5MwL4ZCEaO2rKMcFWAGNrRwl055kIxJyYpka0YU 1lxlvjCXWLqIbQIiqO4IZXZ8ZRdpRjCr/iQm1yFpMYxStdgigcdMnqnOeNAR7pDutnu3DlLTs 5DRUo70y10KxOYAv4Ua/zUPfJb2CFGRxvYAqyJEExXWHsAiir6Bdl2r15MdRTMWGRvppMU7qE Ehq9+a9DdxBuT23EJoXy/l6qmUPWR1668BY8bjcNc8OLLURjhRU0h/C2mxiL4ii4miQbzzx4p DYvN9x7q/Jyw5wATLAEAdhd6fwwwn9ZNSPYhOjZSBJUhlcd8AFLHgOjQ0JhUgqzb+a0qLeDXm SxtGSH/18tni09lEvnrYQj5n5563Q== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Jan 29, 2018 at 03:57:48AM +0100, David Fetter wrote: > == PostgreSQL Weekly News - January 28 2018 == ... > == Applied Patches == ... > Tom Lane pushed: ... > - In pg_dump, force reconnection after issuing ALTER DATABASE SET command(s). > The folly of not doing this was exposed by the buildfarm: in some cases, the > GUC settings applied through ALTER DATABASE SET may be essential to > interpreting the reloaded data correctly. Another argument why we can't > really get away with the scheme proposed in commit b3f840120 is that it cannot > work for parallel restore: even if the parent process manages to hang onto the > previous GUC state, worker processes would see the state post-ALTER-DATABASE. > (Perhaps we could have dodged that bullet by delaying DATABASE PROPERTIES > restoration to the end of the run, but that does nothing for the data > semantics problem.) This leaves us with no solution for the > default_transaction_read_only issue that commit 4bd371f6f intended to work > around, other than "you gotta remove such settings before dumping/upgrading". > However, in view of the fact that parallel restore broke that hack years ago > and no one has noticed, it's fair to question how many people care. I do (I am OP from the original report). The reason no one's noticed is that so far Debian's pg_upgradecluster doesn't by default seem to use more than one job for restore (it does use pg_dump/pg_restore over pg_upgrade by default). > I'm unexcited about adding a large dollop of new complexity to handle that corner > case. This would be a one-liner fix, except it turns out that > ReconnectToServer tries to optimize away "redundant" reconnections. While > that may have been valuable when coded, a quick survey of current callers > shows that there are no cases where that's actually useful, so just remove > that check. While at it, remove the function's useless return value. > Discussion: https://postgr.es/m/12453.1516655001@sss.pgh.pa.us > https://git.postgresql.org/pg/commitdiff/160a4f62ee7b8a96984f8bef19c90488aa6c8045 However, reading _this_ commit message ... > - Move handling of database properties from pg_dumpall into pg_dump. This patch > rearranges the division of labor between pg_dump and pg_dumpall so that > pg_dump itself handles all properties attached to a single database. Notably, > a database's ACL (GRANT/REVOKE status) and local GUC settings established by > ALTER DATABASE SET and ALTER ROLE IN DATABASE SET can be dumped and restored > by pg_dump. This is a long-requested improvement. "pg_dumpall -g" will now > produce only role- and tablespace-related output, nothing about individual > databases. The total output of a regular pg_dumpall run remains the same. > pg_dump (or pg_restore) will restore database-level properties only when > creating the target database with --create. This applies not only to ACLs and > GUCs but to the other database properties it already handled, that is database > comments and security labels. This is more consistent and useful, but does > represent an incompatibility in the behavior seen without --create. (This > change makes the proposed patch to have pg_dump use "COMMENT ON DATABASE > CURRENT_DATABASE" unnecessary, since there is no case where the command is > issued that we won't know the true name of the database. We might still want > that patch as a feature in its own right, but pg_dump no longer needs it.) > pg_dumpall with --clean will now drop and recreate the "postgres" and > "template1" databases in the target cluster, allowing their locale and > encoding settings to be changed if necessary, and providing a cleaner way to > set nondefault tablespaces for them than we had before. This means that such > a script must now always be started in the "postgres" database; the order of > drops and reconnects will not work otherwise. Without --clean, the script > will not adjust any database-level properties of those two databases > (including their comments, ACLs, and security labels, which it formerly would > try to set). Another minor incompatibility is that the CREATE DATABASE > commands in a pg_dumpall script will now always specify locale and encoding > settings. Formerly those would be omitted if they matched the cluster's > default. While that behavior had some usefulness in some migration scenarios, > it also posed a significant hazard of unwanted locale/encoding changes. To > migrate to another locale/encoding, it's now necessary to use pg_dump without > --create to restore into a database with the desired settings. Commit > 4bd371f6f's hack to emit "SET default_transaction_read_only = off" is gone: we > now dodge that problem by the expedient of not issuing ALTER DATABASE SET > commands until after reconnecting to the target database. Therefore, such > settings won't apply during the restore session. In passing, improve some > shaky grammar in the docs, and add a note pointing out that pg_dumpall's > output can't be expected to load without any errors. (Someday we might want > to fix that, but this is not that patch.) Haribabu Kommi, reviewed at various > times by Andreas Karlsson, Vaishnavi Prabakaran, and Robert Haas; further > hacking by me. Discussion: > https://postgr.es/m/CAJrrPGcUurV0eWTeXODwsOYFN=Ekq36t1s0YnFYUNzsmRfdAyA@mail.gmail.com > https://git.postgresql.org/pg/commitdiff/b3f8401205afdaf63cb20dc316d44644c933d5a1 ... am I right in assuming my use case (dumping/restoring databases with default_transaction_read_only=True) should still work without removing that setting beforehand ? Thanks, Karsten -- GPG key ID E4071346 @ eu.pool.sks-keyservers.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346