Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ee1Mj-0004xM-6f for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 16:24:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ee1Mi-0005Qg-N8 for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jan 2018 16:24:04 +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.84_2) (envelope-from ) id 1ee1Mi-0005QX-D2 for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2018 16:24:04 +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 1ee1Mg-0000YJ-0G for pgsql-hackers@lists.postgresql.org; Tue, 23 Jan 2018 16:24:03 +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 w0NGO01M032320; Tue, 23 Jan 2018 11:24:00 -0500 From: Tom Lane To: Haribabu Kommi cc: pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Move handling of database properties from pg_dumpall into pg_dum In-reply-to: References: <12453.1516655001@sss.pgh.pa.us> <17972.1516658167@sss.pgh.pa.us> Comments: In-reply-to Haribabu Kommi message dated "Tue, 23 Jan 2018 18:23:35 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32318.1516724640.1@sss.pgh.pa.us> Date: Tue, 23 Jan 2018 11:24:00 -0500 Message-ID: <32319.1516724640@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Haribabu Kommi writes: > On Tue, Jan 23, 2018 at 8:56 AM, Tom Lane wrote: >> I'm thinking we'd still need to do what I said in the previous message, >> and change pg_dump so that the restore session will absorb ALTER DATABASE >> settings before proceeding. Otherwise, at minimum, we have a hazard of >> differing behaviors in serial and parallel restores. It might be that >> lc_monetary is the only GUC that makes a real difference for this purpose, >> but I haven't got much faith in that proposition at the moment. > Yes, restore session should absorb all the ALTER DATABASE and ALTER ROLE > IN DATABASE settings also to make sure that the target database is in same > state when the dump has started. I've pushed a patch to do that. > currently "default_transaction_read_only" is the only GUC that affects the > absorbing the restore of a database. Well, that's exactly the $64 question. Are we sure we have a complete, reliable list of which GUCs do or do not affect data restoration? I wouldn't count on it. If nothing else, extensions might have custom GUCs that we could not predict the behavior of. > As you said in upthread, I feel splitting them into two _TOC entries and > dump as last commands of each database? Does it have any problem with > parallel restore? As I said yesterday, I'm not really eager to do that. It's a lot of complexity and a continuing maintenance headache to solve a use-case that I find pretty debatable. Anyone who's actually put in "default_transaction_read_only = on" in a way that restricts their maintenance roles must have created procedures for undoing it easily; otherwise day-to-day maintenance would be a problem. Further, I don't find the original hack's distinction between pg_dump and pg_dumpall to be really convincing. Maybe that says we should resolve this by just sticking "SET default_transaction_read_only = off" into regular pg_dump output after all --- perhaps with a switch added to enable it. But I'd kind of like to see the argument why we should worry about this at all made afresh. regards, tom lane