BUG #5544: Bug while loading the csv file into the table

From: "Pavani Mallampati" <pavanimallampati(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #5544: Bug while loading the csv file into the table
Date: 2010-07-08 08:44:37
Message-ID: 201007080844.o688ib7q076422@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 5544
Logged by: Pavani Mallampati
Email address: pavanimallampati(at)gmail(dot)com
PostgreSQL version: 8.3
Operating system: Centos
Description: Bug while loading the csv file into the table
Details:

NOT WORKING
The “postgres” version I am using was mentioned below.
Postgres version:
postgres=# select version();
version

----------------------------------------------------------------------------
---------------------------
PostgreSQL 8.3.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.3
20041212 (Red Hat 3.4.3-9.EL4)
(1 row)
The “gridsql” version I am using was mentioned below.
GRID version:
GridSQL -> select version();
+-------------+
| EXPRESSION5 |
+-------------+
| 1.0.0.6 |
+-------------+
1 row(s).
Creating “emp” table in grid with the syntax.
GridSQL -> create table employee_details(emp_id integer,
GridSQL -> emp_name varchar,
GridSQL -> emp_address varchar) with xrowid;
OK
And the table was successfully created.
Loading the data into the table using copy:
I have a “csv” file like
[postgres(at)localhost ~]$ cat emp.csv
1,postgres1,newyork
2,postgres1,newyork
3,postgres1,newyork
4,postgres1,newyork
5,postgres1,newyork
6,postgres1,newyork
7,postgres1,newyork
8,postgres1,newyork
9,postgres1,newyork
10,postgres1,newyork
While loading the data into the table using the copy command then I am
getting the error as shown below.
GridSQL -> copy employee_details from '/home/postgres/emp.csv' delimiter ','
CSV;
SQLException: ERROR: java.lang.NumberFormatException: For input string:
"newyork"
If I drop the XROWID column then the data is loaded
GridSQL -> alter table employee_details drop column xrowid;
OK
GridSQL -> copy employee_details from '/home/postgres/emp.csv' delimiter ','
CSV;
OK
WHY…………………………………………..
Please reply……………………………………..

WORKING
While working with another version it was working
Postgres version:
postgres=# select version();
version
----------------------------------------------------------------------------
----------------------------------
PostgreSQL 8.3.2 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
(1 row)
GRID version:
GridSQL -> select version();
+---------+
| version |
+---------+
| 1.1.0.9 |
+---------+
1 row(s).
Creating “emp” table in grid with the same syntax.
GridSQL -> create table employee_details(emp_id integer,
GridSQL -> emp_name varchar,
GridSQL -> emp_address varchar) with xrowid;
OK
And the table was successfully created.
Loading the data into the table using copy:
I have a “csv” file like as same as above
[postgres(at)localhost ~]$ cat emp.csv
1,postgres1,newyork
2,postgres1,newyork
3,postgres1,newyork
4,postgres1,newyork
5,postgres1,newyork
6,postgres1,newyork
7,postgres1,newyork
8,postgres1,newyork
9,postgres1,newyork
10,postgres1,newyork
Data loaded successfully:
GridSQL -> copy employee_details from '/home/postgres/emp.csv' delimiter ','
CSV;
OK

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2010-07-08 10:31:30 Re: [TESTERS] Location of certs -Windows 7 SSL mode?
Previous Message Craig Ringer 2010-07-08 01:10:29 Re: [TESTERS] Location of certs -Windows 7 SSL mode?