Re: BUG #15602: pg_dump archive items not in correct section order

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: tcassidy@mossridge.com.au, pgsql-bugs@lists.postgresql.org
Date: 2019-01-23T16:44:17Z
Lists: pgsql-bugs

Attachments

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

Commits

  1. Fix dumping of matviews with indirect dependencies on primary keys.

  2. Fix dumping of a materialized view that depends on a table's primary key.