Import from CSV

From: xuan thang <xuanthang117(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Import from CSV
Date: 2008-04-07 08:32:08
Message-ID: 988143.4270.qm@web55509.mail.re4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,
I'm using The PostgresSQL Interactive Terminal In PostgresSQL 8.1.4.
When I import a table from csv file by command "copy table from './table.csv' with csv header", DB Engine add a new line sequence (\n) after a new line sequence(\n) in origin data automatically.
Example:
My data in Employee.csv file: (this file is exported by The PostgresSQL Interactive terminal )

ID Name Address
1 John City (one new line sequence here)
Country
2.................................................................................

I use The PostgresSQL Interactive terminal to import this csv file to DB by command:
"\copy Employee from './Employee.csv' with csv header"
After import , I have data in table Employee of Postgres DB.

ID Name Address
1 John City (original new line sequence here)
(a new line sequence added here automaticaly)
Country
2.................................................................................

Please help me to import origin data in csv into table.
Thanks alot!
Xuan Thang.

____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Carol Walter 2008-04-07 15:33:13 Tuning
Previous Message Thomas Bräutigam 2008-04-07 06:27:45 Re: Postgres and SUN