pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Restoring pg_dump's made using COPY commands
3+ messages / 3 participants
[nested] [flat]

* Restoring pg_dump's made using COPY commands
@ 2004-02-17 02:59  Mike Miller <temp6453@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Mike Miller @ 2004-02-17 02:59 UTC (permalink / raw)
  To: pgsql-admin

Hi,
  I'm trying to restore two dumps, one from 7.1.3 and the other from a 6.5.3 
series PgSQL server.  These dumps were both made using standard 'pg_dump > 
output' commands (specifying the host where needed on one of them).  When I 
run the database restore by doing execute-file in psql, piping the file to 
psql, or even attempting pg_restore (whcih doesn't work on these plain text 
databases), I receive messages pertaining to:
  invalid command \N
  invalid command \.
  parse error at the end of line
  <occasionally messages about missing fields>

However this dump just came from a pg_dump, so it really should be working.  
I've tried every combination of pg_dump and psql versions from 7.4.1, 7.3.3, 
7.1.3, 6.5.3 in order to get this to work right without any luck.

Can anyone help me out with what is wrong?  I'm looking to make this a 
backup method, and if I can't restore the data, it doesn't do me much good 
(and I'm trying to restore some existing data).  Ultimately want to move 
them all up to 7.4.x

Any ideas as to what causes these errors?  Anything I can do to fix the 
output of pg_dump?

Thanks!
-Mike

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpa...




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

* Re: Restoring pg_dump's made using COPY commands
@ 2004-02-17 16:19  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Mike Miller <temp6453@hotmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2004-02-17 16:19 UTC (permalink / raw)
  To: Mike Miller <temp6453@hotmail.com>; +Cc: pgsql-admin

Mike Miller wrote:
> Hi,
>   I'm trying to restore two dumps, one from 7.1.3 and the other from a 6.5.3 
> series PgSQL server.  These dumps were both made using standard 'pg_dump > 
> output' commands (specifying the host where needed on one of them).  When I 
> run the database restore by doing execute-file in psql, piping the file to 
> psql, or even attempting pg_restore (whcih doesn't work on these plain text 
> databases), I receive messages pertaining to:
>   invalid command \N
>   invalid command \.
>   parse error at the end of line
>   <occasionally messages about missing fields>
> 
> However this dump just came from a pg_dump, so it really should be working.  
> I've tried every combination of pg_dump and psql versions from 7.4.1, 7.3.3, 
> 7.1.3, 6.5.3 in order to get this to work right without any luck.
> 
> Can anyone help me out with what is wrong?  I'm looking to make this a 
> backup method, and if I can't restore the data, it doesn't do me much good 
> (and I'm trying to restore some existing data).  Ultimately want to move 
> them all up to 7.4.x
> 
> Any ideas as to what causes these errors?  Anything I can do to fix the 
> output of pg_dump?

Strange.  We used \N for NULLs way back in 6.5 and earlier.  I wonder if
you have carriage returns in the file accidentally.   Any way to see the
lines that are failing?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



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

* Re: Restoring pg_dump's made using COPY commands
@ 2004-02-17 22:28  Benjamin Wragg <bwragg@tpg.com.au>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Benjamin Wragg @ 2004-02-17 22:28 UTC (permalink / raw)
  To: 'Bruce Momjian' <pgman@candle.pha.pa.us>; 'Mike Miller' <temp6453@hotmail.com>; +Cc: pgsql-admin

I had this problem just yesterday. I found it was due to an error a few
lines before my copy command started.

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Bruce Momjian
Sent: Wednesday, 18 February 2004 2:49 AM
To: Mike Miller
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Restoring pg_dump's made using COPY commands


Mike Miller wrote:
> Hi,
>   I'm trying to restore two dumps, one from 7.1.3 and the other from a

> 6.5.3
> series PgSQL server.  These dumps were both made using standard
'pg_dump > 
> output' commands (specifying the host where needed on one of them).
When I 
> run the database restore by doing execute-file in psql, piping the
file to 
> psql, or even attempting pg_restore (whcih doesn't work on these plain
text 
> databases), I receive messages pertaining to:
>   invalid command \N
>   invalid command \.
>   parse error at the end of line
>   <occasionally messages about missing fields>
> 
> However this dump just came from a pg_dump, so it really should be 
> working.
> I've tried every combination of pg_dump and psql versions from 7.4.1,
7.3.3, 
> 7.1.3, 6.5.3 in order to get this to work right without any luck.
> 
> Can anyone help me out with what is wrong?  I'm looking to make this a
> backup method, and if I can't restore the data, it doesn't do me much
good 
> (and I'm trying to restore some existing data).  Ultimately want to
move 
> them all up to 7.4.x
> 
> Any ideas as to what causes these errors?  Anything I can do to fix 
> the
> output of pg_dump?

Strange.  We used \N for NULLs way back in 6.5 and earlier.  I wonder if
you have carriage returns in the file accidentally.   Any way to see the
lines that are failing?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania
19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly




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


end of thread, other threads:[~2004-02-17 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 02:59 Restoring pg_dump's made using COPY commands Mike Miller <temp6453@hotmail.com>
2004-02-17 16:19 ` Bruce Momjian <pgman@candle.pha.pa.us>
2004-02-17 22:28   ` Benjamin Wragg <bwragg@tpg.com.au>

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