pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rob Sargent <robjsargent@gmail.com>
Cc: Blake McBride <blake@mcbride.name>
Cc: pgsql-general@postgresql.org
Subject: Re: Problem with COPY command on pg_dump
Date: Sat, 09 Dec 2017 11:23:16 -0500
Message-ID: <6646.1512836596@sss.pgh.pa.us> (raw)
In-Reply-To: <93532B21-1F53-424D-954E-1096C2852C12@gmail.com>
References: <CABwHSOvhnqZW1O5aHAZVd8OvhMC_UjhkWQQRcf9VYpbJ9Mr_7g@mail.gmail.com>
	<93532B21-1F53-424D-954E-1096C2852C12@gmail.com>

Rob Sargent <robjsargent@gmail.com> writes:
>> On Dec 9, 2017, at 8:42 AM, Blake McBride <blake@mcbride.name> wrote:
>> I am using pg_dump on version 9.5.10 and trying to import it on version 9.3.20.  Many (or all) COPY commands are failing with messages like:  
>> psql:16504.db:16874: ERROR:  missing data for column "street"
>> CONTEXT:  COPY address, line 1: ""

> Is there in fact ‘street’ data in the file?   Sounds like you have the wrong number of columns. Do you have your actual dump and restore commands to show here?

While pg_dump certainly does sometimes produce output that doesn't reload
into older servers, we try to minimize such problems --- and in any case,
the actual COPY data shouldn't be a source of issues.  I'm suspicious that
the true problem occurred earlier; maybe a table drop/creation failed
and now COPY is trying to load into a pre-existing table that has the
right name and the wrong column list.

I'd counsel looking at the *first* error message and resolving that,
then trying again.  Anything later could just be cascaded failures.

			regards, tom lane




view thread (4+ messages)  latest in thread

Message-ID: <6646.1512836596@sss.pgh.pa.us>
Permalink:  ../6646.1512836596@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6646.1512836596@sss.pgh.pa.us

 · 

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robjsargent@gmail.com, blake@mcbride.name
  Subject: Re: Problem with COPY command on pg_dump
  In-Reply-To: <6646.1512836596@sss.pgh.pa.us>
  References: <CABwHSOvhnqZW1O5aHAZVd8OvhMC_UjhkWQQRcf9VYpbJ9Mr_7g@mail.gmail.com> <93532B21-1F53-424D-954E-1096C2852C12@gmail.com> <6646.1512836596@sss.pgh.pa.us>

* 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