pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: tcassidy@mossridge.com.au
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15602: pg_dump archive items not in correct section order
Date: Wed, 23 Jan 2019 13:44:17 -0300
Message-ID: <201901231644.rh46t3asx75y@alvherre.pgsql> (raw)
In-Reply-To: <15602-e895445f73dc450b@postgresql.org>

On 2019-Jan-22, PG Bug reporting form wrote:

> When I run pg_dump on a database, it reports the following warning:
> 
> pg_dump: [archiver] WARNING: archive items not in correct section order
> 
> 
> The following SQL script replicates the warning when run on a new instance
> of PostgreSQL 11.1:

It does indeed ... curious.

repairDependencyLoop sees this curious case involving ten objects:

repairing loop: 10 (mv_2 [type 12], _RETURN [type 17] (on mv_2), table1_pkey [type 19], POST-DATA BOUNDARY [type 37], foo [type 23], PRE-DATA BOUNDARY [type 36], _mv_1 [type 25], mv_1 [type 25], mv_1 [type 12], _RETURN [type 17] (on mv_1))

(I just patched it to print the loop objects as attached)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

dump-sort.patch (text/x-diff, 760B) download diff --git a/src/bin/pg_dump/pg_dump_sort.c b/src/bin/pg_dump/pg_dump_sort.c index 08005c530f..e17d05d88b 100644 --- a/src/bin/pg_dump/pg_dump_sort.c +++ b/src/bin/pg_dump/pg_dump_sort.c @@ -876,6 +876,18 @@ repairDependencyLoop(DumpableObject **loop, int i, j; + fprintf(stderr, "repairing loop: %d (", nLoop); + for (i = 0; i < nLoop; i++) + { + fprintf(stderr, "%s [type %d]", loop[i]->name, loop[i]->objType); + if (loop[i]->objType == DO_RULE) + fprintf(stderr, " (on %s)", ((DumpableObject *) + (((RuleInfo *) loop[i])->ruletable))->name); + if (i < nLoop -1) + fprintf(stderr, ", "); + } + fprintf(stderr, ")\n"); + /* Datatype and one of its I/O or canonicalize functions */ if (nLoop == 2 && loop[0]->objType == DO_TYPE &&

view thread (5+ messages)  latest in thread

Message-ID: <201901231644.rh46t3asx75y@alvherre.pgsql>
Permalink:  ../201901231644.rh46t3asx75y@alvherre.pgsql/
Also on:    postgresql.org/message-id/201901231644.rh46t3asx75y@alvherre.pgsql

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, tcassidy@mossridge.com.au, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15602: pg_dump archive items not in correct section order
  In-Reply-To: <201901231644.rh46t3asx75y@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox