BUG #8577: pg_dump custom format exported dump can't be imported again

From: dominik(at)dominikdorn(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8577: pg_dump custom format exported dump can't be imported again
Date: 2013-11-05 20:53:32
Message-ID: E1Vdncy-0002HS-7a@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8577
Logged by: Dominik Dorn
Email address: dominik(at)dominikdorn(dot)com
PostgreSQL version: 9.1.10
Operating system: Ubuntu x64
Description:

Hi,

I ran into an issue trying to restore a custom dump from postgresql 9.1.10
from one machine into postgresql 9.1.10 on my CI machine.

For some reason, pg_dump inserts an entry with null values into the dump
(even for the primary key).

The commands I used are:

pg_dump -Fc -f dump.sql mydatabase (on the source machine)

pg_restore -e -d mydatabase_2013_11_05 dump.sql

The error I get is:
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

the table in question looks like this:

lyriks=> \d lyriks.lytartist
Table "lyriks.lytartist"
Column | Type |
Modifiers
----------------+-----------------------------+---------------------------------------------------------------
nartistnr | integer | not null default
nextval('lytartist_nartistnr_seq'::regclass)
sartist | character varying(250) | not null default
''::character varying
nartistnralias | integer |
nstatusnr | integer | not null default 1660
ntypenr | integer | not null default 510
surl | character varying(250) | not null default
''::character varying
nlabelnr | integer |
nusernr | integer | not null default 0
dnow | timestamp without time zone | not null
ssoundex | character varying(250) |
surlname | character varying(100) |

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

Please help!

Thanks,
Dominik

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Maxy 2013-11-05 21:00:23 Re: psql security fail?
Previous Message Alvaro Herrera 2013-11-05 20:30:21 Re: psql security fail?