pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeanna Geier <jgeier@apt-cafm.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: RESTORE Error
Date: Thu, 11 Jan 2007 22:27:39 -0500
Message-ID: <29961.1168572459@sss.pgh.pa.us> (raw)
In-Reply-To: <FBEGJLLJBCOMCDBJHIMECEPFCCAA.jgeier@apt-cafm.com>
References: <FBEGJLLJBCOMCDBJHIMECEPFCCAA.jgeier@apt-cafm.com>

"Jeanna Geier" <jgeier@apt-cafm.com> writes:
> And log file shows the following (what I posted before was through pgAdmin):
> 2007-01-11 15:38:47 ERROR:  relation "temp_measurement" does not exist
> 2007-01-11 15:38:47 ERROR:  syntax error at or near "7094982" at character 1
> 2007-01-11 15:38:47 ERROR:  syntax error at or near "67459" at character 1

OK, that makes it come a bit into focus.  I think what pg_restore tried
to send was

COPY temp_measurement FROM STDIN;
7094982	... rest of row 1 ...
67459 ... rest of row 2 ...

and the COPY command failed because of the stated reason, and then the
backend found itself chewing on a lot of data that was being sent as SQL
commands (because back then pg_restore depended on feedback from the
backend to tell whether an archive entry was COPY data or SQL commands).

So the bottom line here is you're trying to restore into a table that's
not there.  How come?  I suppose you were trying a data-only restore,
else this is a pg_dump or pg_restore bug.

Another point is that AFAICT 8.0 pg_restore does know enough to stop
if the COPY command fails --- least the case seems to work for me.
[ digs in CVS logs... ]  Oh, it seems we fixed that in 8.0.7:

2006-02-05 15:59  tgl

	* src/bin/pg_dump/: pg_backup_archiver.c, pg_backup_archiver.h,
	pg_backup_db.c (REL8_0_STABLE): Fix pg_restore to properly discard
	COPY data when trying to continue after an error in a COPY
	statement.  Formerly it thought the COPY data was SQL commands, and
	got quite confused.
	
	Stephen Frost

So I suppose you're running some earlier 8.0.x subrelease, in which case
an update would be an extremely good idea.

			regards, tom lane



view thread (9+ messages)  latest in thread

Message-ID: <29961.1168572459@sss.pgh.pa.us>
Permalink:  ../29961.1168572459@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29961.1168572459@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, jgeier@apt-cafm.com
  Subject: Re: RESTORE Error
  In-Reply-To: <29961.1168572459@sss.pgh.pa.us>
  References: <FBEGJLLJBCOMCDBJHIMECEPFCCAA.jgeier@apt-cafm.com> <29961.1168572459@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