Thread: SuSE 7.1 PostgreSQL COPY

SuSE 7.1 PostgreSQL COPY

From
"John Jeffery"
Date:
Hello from Robertson NSW "Babe Country"
I am trying to do something very simple
Populate a partshistory table with 8 fields from a text, or csv or tab 
delimited file which was generated on winme using Fortran90

the fields are
partnum varchar(15)
partdesc varvhar(20)
price    money
currency_code char(2)
discount_code char(2)
weight   int4
Model_Name  char(4)
Package_Qty int4
tried COPY from psql with the following;

COPY parthist FROM '/var/lib/pgsql/parthist.txt';

COPY finishes ok but table only imports one field the first one.
Tried tab delimit , comma, blank, pipe. still the same
tried import using pgaccess same result
tried generating file with different order of fields etc
same result only first field gets into table.

Any suggestions ?



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp



Re: SuSE 7.1 PostgreSQL COPY

From
"Jeff Eckermann"
Date:
Likely reason is that the line ending characters in your file are not being
recognized, so PostgreSQL thinks that all of your file is in one line, and
additional fields are being lopped off.
In that case, you should see a warning message from COPY, saying "extra
fields disregarded" or something to that effect.
----- Original Message -----
From: "John Jeffery" <jepjeffery@hotmail.com>
To: <pgsql-interfaces@postgresql.org>
Sent: Sunday, August 19, 2001 10:02 PM
Subject: [INTERFACES] SuSE 7.1 PostgreSQL COPY


> Hello from Robertson NSW "Babe Country"
> I am trying to do something very simple
> Populate a partshistory table with 8 fields from a text, or csv or tab
> delimited file which was generated on winme using Fortran90
>
> the fields are
> partnum varchar(15)
> partdesc varvhar(20)
> price    money
> currency_code char(2)
> discount_code char(2)
> weight   int4
> Model_Name  char(4)
> Package_Qty int4
> tried COPY from psql with the following;
>
> COPY parthist FROM '/var/lib/pgsql/parthist.txt';
>
> COPY finishes ok but table only imports one field the first one.
> Tried tab delimit , comma, blank, pipe. still the same
> tried import using pgaccess same result
> tried generating file with different order of fields etc
> same result only first field gets into table.
>
> Any suggestions ?
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
>