Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKX1V-0007AI-1y for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2017 21:37:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dKX1U-0000fZ-Kq for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Jun 2017 21:37:20 +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 1dKWzv-0003qv-MM for pgsql-hackers@postgresql.org; Mon, 12 Jun 2017 21:35:43 +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.84_2) (envelope-from ) id 1dKWzt-0002Po-BX for pgsql-hackers@postgresql.org; Mon, 12 Jun 2017 21:35:42 +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 v5CLZbpP011214; Mon, 12 Jun 2017 17:35:37 -0400 From: Tom Lane To: Andres Freund cc: Peter Eisentraut , pgsql-hackers@postgresql.org Subject: Re: Transactional sequence stuff breaks pg_upgrade In-reply-to: <20170612212517.j3xe6am7hlztl6fw@alap3.anarazel.de> References: <19785.1497215827@sss.pgh.pa.us> <9761.1497225808@sss.pgh.pa.us> <20170612210221.vz2u373tcwu3g624@alap3.anarazel.de> <23291.1497302014@sss.pgh.pa.us> <20170612212517.j3xe6am7hlztl6fw@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 12 Jun 2017 14:25:17 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11212.1497303337.1@sss.pgh.pa.us> Date: Mon, 12 Jun 2017 17:35:37 -0400 Message-ID: <11213.1497303337@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > In my opinion the problem of: > On 2017-06-12 17:13:34 -0400, Tom Lane wrote: >> assignments of relfilenodes have to be shortcircuited by pg_upgrade >> override calls during a binary-restore run, or we risk filename >> collisions. > should instead be solved by simply not even trying to preserve > relfilenodes. We can "just" copy/link files to the the new > relfilenodes, there's no need to preserve them, in contrast to > pg_class.oid etc. But that's obviously something for the future. Right. But until somebody gets around to fixing that, it's a problem. Also, even if we fix this, we still have the issue of type OIDs residing on-disk in places like array headers; that results in pg_upgrade having to control type OID assignments as well. I thought about trying to insert an assert in GetNewOidWithIndex to ensure that no type OIDs are selected automatically during upgrade, but it seemed a bit too complicated. Might be a good idea to figure it out though, unless you have an idea for removing that requirement. >> I intend to not only commit this, but back-patch it. There's enough >> changes in relevant code paths that logic that is fine in HEAD might >> not be fine in back branches. > Hm. Just found out that 9.4 (and probably older) fail the assertion because of the temp table created in get_rel_infos(). That's *probably* all right because the table is *probably* gone from disk by the time we start the actual restore run. But we start the new postmaster only once, with -b, so the assertion applies to the preparatory steps as well as the restore proper. Later versions avoid that by using a CTE instead of a temp table. I'm not excited enough about this to back-port the patch that changed it, so I'm thinking of just adding the assert back to 9.5. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers