BUG #15602: pg_dump archive items not in correct section order
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: tcassidy@mossridge.com.au
Date: 2019-01-22T06:06:20Z
Lists: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 15602
Logged by: Tom Cassidy
Email address: tcassidy@mossridge.com.au
PostgreSQL version: 11.1
Operating system: Devuan 2.0 ASCII
Description:
Operating System: Devuan 2.0 ASCII (derivative of Debian 9/stretch)
Hardware: KVM Virtual Machine
PostgreSQL version: PostgreSQL 11.1 (Debian 11.1-1.pgdg90+1) on
x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0
20170516, 64-bit
pg_dump version: pg_dump (PostgreSQL) 11.1 (Debian 11.1-1.pgdg90+1)
Kernel: Linux 4.9.0-8-amd64
System Memory: 1GB
C library: libc6 (2.24-11+deb9u3)
Installation: following the quickstart instrunctions on
https://wiki.postgresql.org/wiki/Apt, installing the postgresql-11 package
from apt.postgresql.org for Debian 9/stretch
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:
postgres@devuan:/tmp$ cat test_case.sql
CREATE DATABASE test_mv TEMPLATE template0;
\c test_mv
CREATE TABLE table1
(
id bigint NOT NULL,
name text NOT NULL,
CONSTRAINT table1_pkey PRIMARY KEY (id)
);
CREATE TABLE table2
(
id bigint NOT NULL,
CONSTRAINT table2_pkey PRIMARY KEY (id)
);
CREATE MATERIALIZED VIEW mv_2
AS
SELECT table1.name,
table1.id
FROM table1
GROUP BY table1.id;
CREATE MATERIALIZED VIEW mv_1
AS
SELECT z.name,
a.id AS a_id,
z.id AS z_id
FROM table1 a
JOIN ( SELECT mv_2.name,
mv_2.id
FROM mv_2) z ON z.id = a.id;
postgres@devuan:/tmp$
I have tested this on a new installation of PostgreSQL 11.1 using the
following commands:
postgres@devuan:/tmp$ psql -f test_case.sql
postgres@devuan:/tmp$ pg_dump test_mv > test_mv.sql
pg_dump: [archiver] WARNING: archive items not in correct section order
postgres@devuan:/tmp$
Verbose pg_dump:
postgres@devuan:/tmp$ pg_dump --verbose test_mv > test_mv.sql
pg_dump: last built-in OID is 16383
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined access methods
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined operator families
pg_dump: reading user-defined text search parsers
pg_dump: reading user-defined text search templates
pg_dump: reading user-defined text search dictionaries
pg_dump: reading user-defined text search configurations
pg_dump: reading user-defined foreign-data wrappers
pg_dump: reading user-defined foreign servers
pg_dump: reading default privileges
pg_dump: reading user-defined collations
pg_dump: reading user-defined conversions
pg_dump: reading type casts
pg_dump: reading transforms
pg_dump: reading table inheritance information
pg_dump: reading event triggers
pg_dump: finding extension tables
pg_dump: finding inheritance relationships
pg_dump: reading column info for interesting tables
pg_dump: finding the columns and types of table "public.table1"
pg_dump: finding the columns and types of table "public.table2"
pg_dump: finding the columns and types of table "public.mv_2"
pg_dump: finding the columns and types of table "public.mv_1"
pg_dump: flagging inherited columns in subtables
pg_dump: reading indexes
pg_dump: reading indexes for table "public.table1"
pg_dump: reading indexes for table "public.table2"
pg_dump: flagging indexes in partitioned tables
pg_dump: reading extended statistics
pg_dump: reading constraints
pg_dump: reading triggers
pg_dump: reading rewrite rules
pg_dump: reading policies
pg_dump: reading row security enabled for table "public.table1"
pg_dump: reading policies for table "public.table1"
pg_dump: reading row security enabled for table "public.table2"
pg_dump: reading policies for table "public.table2"
pg_dump: reading row security enabled for table "public.mv_2"
pg_dump: reading policies for table "public.mv_2"
pg_dump: reading row security enabled for table "public.mv_1"
pg_dump: reading policies for table "public.mv_1"
pg_dump: reading publications
pg_dump: reading publication membership
pg_dump: reading publication membership for table "public.table1"
pg_dump: reading publication membership for table "public.table2"
pg_dump: reading subscriptions
pg_dump: reading large objects
pg_dump: reading dependency data
pg_dump: saving encoding = UTF8
pg_dump: saving standard_conforming_strings = on
pg_dump: saving search_path =
pg_dump: [archiver] WARNING: archive items not in correct section order
pg_dump: creating TABLE "public.table1"
pg_dump: creating TABLE "public.table2"
pg_dump: processing data for table "public.table1"
pg_dump: dumping contents of table "public.table1"
pg_dump: processing data for table "public.table2"
pg_dump: dumping contents of table "public.table2"
pg_dump: creating CONSTRAINT "public.table1 table1_pkey"
pg_dump: creating MATERIALIZED VIEW "public.mv_2"
pg_dump: creating MATERIALIZED VIEW "public.mv_1"
pg_dump: creating CONSTRAINT "public.table2 table2_pkey"
pg_dump: creating MATERIALIZED VIEW DATA "public.mv_2"
pg_dump: creating MATERIALIZED VIEW DATA "public.mv_1"
postgres@devuan:/tmp$
Commits
-
Fix dumping of matviews with indirect dependencies on primary keys.
- dc42602f1f6d 10.7 landed
- b8de846a511a 11.2 landed
- 9368ba174faf 9.5.16 landed
- 6e4d45b5f6ba 12.0 landed
- 2f93b74bf362 9.4.21 landed
- 16e0464a11d8 9.6.12 landed
-
Fix dumping of a materialized view that depends on a table's primary key.
- 62215de29257 9.4.0 cited