Current HEAD creates dumps that can't be loaded

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: pgsql-bugs mailing list <pgsql-bugs(at)postgresql(dot)org>
Subject: Current HEAD creates dumps that can't be loaded
Date: 2019-04-30 17:39:08
Message-ID: 20190430173908.ozqdw36tqxfqpt7k@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,
I tested commit 9f8b717a80c59e4a8e8091a8ff6c6f7666a69c33 on my computer.
Version string: PostgreSQL 12devel on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit

To test, I created simple partitioned table:

------------------
CREATE TABLE users ( username text PRIMARY KEY, password text ) PARTITION BY HASH ( username );
CREATE TABLE users_0 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 0);
CREATE TABLE users_1 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 1);
CREATE TABLE users_2 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 2);
CREATE TABLE users_3 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 3);
CREATE TABLE users_4 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 4);
CREATE TABLE users_5 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 5);
CREATE TABLE users_6 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 6);
CREATE TABLE users_7 partition OF users FOR VALUES WITH (MODULUS 8, REMAINDER 7);
------------------

Then, I made two dumps:

pg_dump > dump.plain.sql
pg_dump -Fd -f dump.dir

Then, I tried to load the dumps to another database, using:

dropdb test; createdb test; psql -d test -f dump.plain.sql -qAtX &> dump.plain.log
dropdb test; createdb test; pg_restore -d test -Fd dump.dir/ &> dump.dir.log

Both restores failed!

Plain had errors like:
ERROR: column "username" in child table must be marked NOT NULL
ERROR: cannot attach index "users_0_pkey" as a partition of index "users_pkey"

And the dir based:
ERROR: column "username" in child table must be marked NOT NULL
ERROR: relation "public.users_X" does not exist
ERROR: relation "public.users_X_pkey" does not exist

Full dumps and logs are available here:
https://www.depesz.com/various/pg-bug-2019-04-30/test.dumps.tar.gz

Best regards,

depesz

Browse pgsql-bugs by date

  From Date Subject
Next Message Rashid Abzalov 2019-04-30 19:44:44 Prepared statement is not re-parsed after used type is re-created - ERROR: cache lookup failed for type NNN
Previous Message Nick Anderson 2019-04-30 14:49:38 RE: RE: Re: Re: BUG #15769: The database cluster intialisation failed.