Re: command line v GUI and COPY - Mailing list pgsql-novice

From John Polo
Subject Re: command line v GUI and COPY
Date
Msg-id 543D6E19.5040503@okstate.edu
Whole thread Raw
In response to Re: command line v GUI and COPY  (jared <afonit@gmail.com>)
Responses Re: command line v GUI and COPY  (jared <afonit@gmail.com>)
List pgsql-novice
On 10/14/2014 12:11 PM, jared wrote:
for GUI, do you have pgadmin installed?
Yes. I created the DB "FIA" with it and in the tree under "Tables", right-clicking has an option for New Table, but I don't know which of the tabs, if any, let me import existing data at the time of creating the new table in the pgadmin menu.

For the 'extra data after the last column'

The error should have given you a row number.  Did you open up the file and that row number and make sure there wasn't?
This is how the data originally appears in the file. The error says it was in row 2. It looked like there was an extra pair of quotes and then an odd quote at the very end.
"CN","PLT_CN","INVYR","STATECD","UNITCD","COUNTYCD","PLOT","SUBP","SUBPTYP","BNDCHG","CONTRAST","AZMLEFT","AZMCORN","DISTCORN","AZMRIGHT","CYCLE","SUBCYCLE","CREATED_BY","CREATED_DATE","CREATED_IN_INSTANCE","MODIFIED_BY","MODIFIED_DATE","MODIFIED_IN_INSTANCE"
"202492243010854","157287634010478",2008,40,1,5,131,2,1,,2,276,0,,70,7,1,"",2011-05-02,"10854","",,""

I used Notepad++ to open the file and get rid of the quotes and just leave the trailing commas for the three empty fields. Still the same error message. I tried again, deleting the commas trailing after "10854" to see if that would get rid of the problem. Just in case, I opened in LibreOffice Calc, I can't see any other contents in the cells. I couldn't find anything in the fields, tried to delete them anyway. Searched the web and came across the comment about adding to an existing table. I still don't know what's causing the problem.

John

pgsql-novice by date:

Previous
From: jared
Date:
Subject: Re: command line v GUI and COPY
Next
From: jared
Date:
Subject: Re: command line v GUI and COPY