Re: command line v GUI and COPY

From: John Polo <polo(at)okstate(dot)edu>
To: jared <afonit(at)gmail(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: command line v GUI and COPY
Date: 2014-10-14 18:40:25
Message-ID: 543D6E19.5040503@okstate.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message jared 2014-10-14 19:03:52 Re: command line v GUI and COPY
Previous Message jared 2014-10-14 17:11:05 Re: command line v GUI and COPY