Re: BUG #8577: pg_dump custom format exported dump can't be imported again - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #8577: pg_dump custom format exported dump can't be imported again
Date
Msg-id 20131105211536.GI14819@awork2.anarazel.de
Whole thread Raw
In response to BUG #8577: pg_dump custom format exported dump can't be imported again  (dominik@dominikdorn.com)
Responses Re: BUG #8577: pg_dump custom format exported dump can't be imported again  (Dominik Dorn <dominik@dominikdorn.com>)
List pgsql-bugs
On 2013-11-05 20:53:32 +0000, dominik@dominikdorn.com wrote:
> For some reason, pg_dump inserts an entry with null values into the dump
> (even for the primary key).

> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 3370; 0 61665 TABLE DATA
> lytartist lyriks
> pg_restore: [archiver (db)] COPY failed for table "lytartist": ERROR:  null
> value in column "nartistnr" violates not-null constraint
> CONTEXT:  COPY lytartist, line 21841: "\N    \N    \N    \N    \N    \N    \N    \N    \N    \N    \N"
> pg_restore: [archiver] worker process failed: exit code 1

Hm. That might be caused by on-disk corruption...

> Of course, querying for the entry with a NULL PK results in no results on
> the source machine.

Well, that will probably have used the the index, try it by doing
something like:
SET enable_indexscan = false;
SET enable_bitmapscan = false;
SET constraint_exclusion = false;
EXPLAIN SELECT ctid, * FROM lytartist WHERE nartistnr IS NULL;
SELECT ctid, * FROM lytartist WHERE nartistnr IS NULL;

The explain should show a sequential scan, right? Does it now return a row?

Greetings,

Andres Freund

pgsql-bugs by date:

Previous
From: dominik@dominikdorn.com
Date:
Subject: BUG #8577: pg_dump custom format exported dump can't be imported again
Next
From: Dominik Dorn
Date:
Subject: Re: BUG #8577: pg_dump custom format exported dump can't be imported again