Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRfaN-0005vR-Vm for pgsql-committers@arkaria.postgresql.org; Tue, 27 Nov 2018 15:47:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gRfaM-0007kP-Ou for pgsql-committers@arkaria.postgresql.org; Tue, 27 Nov 2018 15:47:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRfaM-0007g8-Fa for pgsql-committers@lists.postgresql.org; Tue, 27 Nov 2018 15:47:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gRfaJ-0008GE-Sw for pgsql-committers@lists.postgresql.org; Tue, 27 Nov 2018 15:47:37 +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 wARFlUrg002736; Tue, 27 Nov 2018 10:47:30 -0500 From: Tom Lane To: Andrew Dunstan cc: Andres Freund , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Update pg_upgrade test for reg* to include regrole and regnamesp In-reply-to: <6f5edd28-e55f-7399-d89c-d2d1ed2d1e51@2ndQuadrant.com> References: <8863.1543297423@sss.pgh.pa.us> <20181127063226.mpyijg3jwrmmm3rr@alap3.anarazel.de> <6f5edd28-e55f-7399-d89c-d2d1ed2d1e51@2ndQuadrant.com> Comments: In-reply-to Andrew Dunstan message dated "Tue, 27 Nov 2018 10:32:05 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2734.1543333649.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Nov 2018 10:47:29 -0500 Message-ID: <2735.1543333649@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Dunstan writes: > In any case, I think we will probably need to bite the bullet and have = > pg_dump render LOs in OID order. +1. Looking at the relevant code: /* * Currently, we re-fetch all BLOB OIDs using a cursor. Consider scan= ning * the already-in-memory dumpable objects instead... */ if (fout->remoteVersion >=3D 90000) blobQry =3D "DECLARE bloboid CURSOR FOR SELECT oid FROM pg_largeob= ject_metadata"; else blobQry =3D "DECLARE bloboid CURSOR FOR SELECT DISTINCT loid FROM = pg_largeobject"; I suspect that the original expectation was that SELECT DISTINCT would deliver the blob OIDs in sorted order, and nobody noticed when hash-based DISTINCT broke that, and then the pg_largeobject_metadata patch figured that it didn't need to preserve a guarantee that wasn't there. We have taken pains in the past to ensure consistent dump ordering, and it seems to me the lack of that here is just an oversight. It's kinda surprising that it hasn't bit us before. > Not sure if that needs to be always on, = > or an option. We have no existing option that says "you can skip ordering my dump consistently". I see no need for one here. The easy fix is to add "ORDER BY 1" to both of the above queries. If anyone is concerned about the performance of that, they could go try to do what the comment suggests, but I'm not personally excited about that. regards, tom lane