Skip site navigation (1) Skip section navigation (2)

8.3b2: problem using "COPY ... TO/FROM .... BINARY"

From: "Thomas H(dot)" <me(at)alternize(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: 8.3b2: problem using "COPY ... TO/FROM .... BINARY"
Date: 2007-11-17 19:45:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
hi there

i'm not sure it its really a bug - the manual specifies that COPY ... 
BINARY between different PGSQL versions might be problematic.

nevertheless: i've imported several tables from 8.2.5 to 8.3b2 without 
any problems, until one table produced an error on a timestamp field:

from pgsql 8.2.5:

COPY "users"."ratings" TO '/temp/ratings' BINARY;

pgsql 8.3b2:

COPY "users"."ratings" FROM '/temp/ratings' BINARY;

2007-11-17 20:17:55 CET ERROR:  timestamp out of range
2007-11-17 20:17:55 CET CONTEXT:  COPY ratings, line 15081, column r_date

when using COPY ... CVS/TEXT; everything works. by using CVS output, i 
was able do determine that the failing record is:

447,883,0.0,1999-01-01 00:00:00,f

it seems to be the only timestamp that is failing, i've removed it from 
the source table and was able to binary copy the remaining data without 

is this a bug or a feature? :)

- thomas

ps: is there a way to convert the binary file to plain sql to directly 
check which record fails? i've tried to use pg_restore to read the file, 
but it said "does not appear to be a valid archive".


pgsql-bugs by date

Next:From: Tom LaneDate: 2007-11-17 19:51:43
Subject: Re: 8.3b2: problem using "COPY ... TO/FROM .... BINARY"
Previous:From: Tom LaneDate: 2007-11-17 16:17:36
Subject: Re: Start up error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group