pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with COPY command on pg_dump
4+ messages / 3 participants
[nested] [flat]

* Problem with COPY command on pg_dump
@ 2017-12-09 15:42 Blake McBride <blake@mcbride.name>
  2017-12-09 15:53 ` Re: Problem with COPY command on pg_dump Rob Sargent <robjsargent@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Blake McBride @ 2017-12-09 15:42 UTC (permalink / raw)
  To: pgsql-general

Greetings,

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 an easy way for me to fix this (like export with some
compatibility flag)?

Thanks!

Blake McBride

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Problem with COPY command on pg_dump
  2017-12-09 15:42 Problem with COPY command on pg_dump Blake McBride <blake@mcbride.name>
@ 2017-12-09 15:53 ` Rob Sargent <robjsargent@gmail.com>
  2017-12-09 16:23   ` Re: Problem with COPY command on pg_dump Tom Lane <tgl@sss.pgh.pa.us>
  2017-12-09 16:29   ` Re: Problem with COPY command on pg_dump Blake McBride <blake@mcbride.name>
  0 siblings, 2 replies; 4+ messages in thread

From: Rob Sargent @ 2017-12-09 15:53 UTC (permalink / raw)
  To: Blake McBride <blake@mcbride.name>; +Cc: pgsql-general



> On Dec 9, 2017, at 8:42 AM, Blake McBride <blake@mcbride.name> wrote:
> 
> Greetings,
> 
> 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 an easy way for me to fix this (like export with some compatibility flag)?
> 
> Thanks!
> 
> Blake McBride

> 
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?





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Problem with COPY command on pg_dump
  2017-12-09 15:42 Problem with COPY command on pg_dump Blake McBride <blake@mcbride.name>
  2017-12-09 15:53 ` Re: Problem with COPY command on pg_dump Rob Sargent <robjsargent@gmail.com>
@ 2017-12-09 16:23   ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2017-12-09 16:23 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: Blake McBride <blake@mcbride.name>; pgsql-general

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Problem with COPY command on pg_dump
  2017-12-09 15:42 Problem with COPY command on pg_dump Blake McBride <blake@mcbride.name>
  2017-12-09 15:53 ` Re: Problem with COPY command on pg_dump Rob Sargent <robjsargent@gmail.com>
@ 2017-12-09 16:29   ` Blake McBride <blake@mcbride.name>
  1 sibling, 0 replies; 4+ messages in thread

From: Blake McBride @ 2017-12-09 16:29 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: pgsql-general

I suppose it's something I'm doing.  I'm pg_dump'ing the schema with the
data, so I can't be missing any columns.  However, I wrote a program to
filter out certain data.  I believe that is where the problem is.  I wrote
it a long, long time ago before --exclude-table-data existed.  When I
use --exclude-table-data
it works.

Thanks.

Blake

On Sat, Dec 9, 2017 at 9:53 AM, Rob Sargent <robjsargent@gmail.com> wrote:

>
>
> > On Dec 9, 2017, at 8:42 AM, Blake McBride <blake@mcbride.name> wrote:
> >
> > Greetings,
> >
> > 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 an easy way for me to fix this (like export with some
> compatibility flag)?
> >
> > Thanks!
> >
> > Blake McBride
>
> >
> 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?
>
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2017-12-09 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-12-09 15:42 Problem with COPY command on pg_dump Blake McBride <blake@mcbride.name>
2017-12-09 15:53 ` Rob Sargent <robjsargent@gmail.com>
2017-12-09 16:23   ` Tom Lane <tgl@sss.pgh.pa.us>
2017-12-09 16:29   ` Blake McBride <blake@mcbride.name>

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