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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

How to import a csv



Hi, I am trying to import a file into a table.
 
The file has the form
integer, string
integer, string
 
Table has 5 columns, but I just need to fill the first two, the others can remain blank
 
I've tried COPY table1 FROM 'C:\\file.txt'
 
But PGAdmin ||| complains
with the following :
ERROR: invalid input syntax for integer: " 319613 , Sapo  "
SQL state: 22P02
 
319613 , Sapo is the very first line of the file.
It seems that it is trying to put the pair (integer, string) in the first column alone
 
How can I fix this?
 
Thanx in advance for your help
 
Best,
Oliveiros


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group