Help with copy (loading TSV file into table as text) - Mailing list pgsql-general

From Allan Kamau
Subject Help with copy (loading TSV file into table as text)
Date
Msg-id CAF3N6oSTE=vSNyPABsa70VWV+nzgL56ze7FDFOpEc2ZrrKB3pg@mail.gmail.com
Whole thread Raw
Responses Re: Help with copy (loading TSV file into table as text)  (Raymond O'Donnell <rod@iol.ie>)
Re: Help with copy (loading TSV file into table as text)  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
List pgsql-general
Hi,
I have a tab delimited file with over a thousand fields (columns)
which I would like to import into postgreSQL.

I have opted to import the entire record (line) of this file into a
single field in a table, one table record per file line. Later split
the contents of the field accordingly into an array for further
processing and decomposition.

I am using the COPY command as follows
#COPY a.t(raw_data)FROM '/data/tmp/t.txt';

and it reports "ERROR:  extra data after last expected column".


#COPY a.t(raw_data)FROM '/data/tmp/t.txt' WITH FORMAT text;

yields "ERROR:  syntax error at or near "FORMAT"


I am running PostgreSQL 9.1.1 compiled from source and deployed on
Fedora Core 14 64bit. Below is the output of version();

m=> SELECT VERSION();
                                                   version
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.1.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.5 20101112 (Red Hat 4.4.5-2), 64-bit
(1 row)


Allan.

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: [pgadmin-support] Help for Migration
Next
From: Szymon Guz
Date:
Subject: strange java query behaviour