pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dominik@dominikdorn.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8577: pg_dump custom format exported dump can't be imported again
Date: Tue, 05 Nov 2013 20:53:32 +0000
Message-ID: <E1Vdncy-0002HS-7a@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      8577
Logged by:          Dominik Dorn
Email address:      dominik@dominikdorn.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








-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <E1Vdncy-0002HS-7a@wrigleys.postgresql.org>
Permalink:  ../E1Vdncy-0002HS-7a@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1Vdncy-0002HS-7a@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: dominik@dominikdorn.com
  Subject: Re: BUG #8577: pg_dump custom format exported dump can't be imported again
  In-Reply-To: <E1Vdncy-0002HS-7a@wrigleys.postgresql.org>
  References: <E1Vdncy-0002HS-7a@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox