[Babase] another postgresql question
Susan Alberts
alberts at duke.edu
Thu Feb 22 18:10:03 EST 2007
OK Leah and I just spent some time on this problem and it turns out
that the import function works perfectly on the PC and not on the
Mac. My first guess is that the issue might be Safari so I will try a
new browser. Karl, do you have any other suggestions? It is
definitely a mac-pc difference because we did EXACTLY the same thing
on the pc that we did on the mac and it worked on one and not the other.
Susan
On Feb 22, 2007, at 2:01 AM, Karl O. Pinc wrote:
>
> On 02/21/2007 08:46:20 PM, Susan Alberts wrote:
>> Hi again,
>> I have a csv file that i want to import into my schema. I created
>> a table in my schema with the appropriate number of columns, then
>> selected it and chose "import" from the last of tabs on the top. I
>> chose the csv file in question, clicked Import, and it said
>> "import successful" or something like this. The table still had
>> zero rows. What am i missing?
>> I tried the postgresql website but I am not very conversant with
>> that yet and didn't get far.
>
> The place to look would be the ppa website, and I don't think
> you'll find help on that there.
>
> It's hard to say what you're missing from here. I could look at the
> data and the table you made and try it myself.
>
> As a random guess, the file uploaded to papio (and you got a message)
> but there was a datatype mis-match between the data
> and the columns of your table which is why it didn't make
> it in.
>
> I worked out
> an import procedure with Leah that worked. You could try that.
>
> What we did was use the sql window and the COPY command.
> (For the COPY command docs see:
> http://www.postgresql.org/docs/8.1/static/sql-copy.html
> The procedure below uses "Text formatted" data.)
>
> IIRC we put the following COPY command in the first line
> of the SQL window:
>
> COPY mytablename FROM STDIN
>
> Then we selected all the rows to import from a spreadsheet
> with the mouse and did a COPY/PASTE operation to put
> the rows after the above COPY command. (This put
> the data into the window using tabs as a separator
> between columns.)
>
> Then at the bottom of all the data we put the following
> 2 lines:
>
> \.
> ;
>
>
> (I think maybe the semicolon could be left off.)
>
> Then hit the button that executes the query.
>
> If that doesn't work I'd expect to get a useful
> error message.
>
> There's a way to do it from a file too but I don't
> recall it well enough to type it out right now,
> and I recall Leah had problems saving things as a file
> which is why we did it this way.
>
> (Note you can't
> COPY mytable FROM FILE 'foo'
> directly unless the "foo" file is on papio.)
>
> Send me the file off-list if you want me to look
> at it.
>
>
> Karl <kop at meme.com>
> Free Software: "You don't pay back, you pay forward."
> -- Robert A. Heinlein
>
> _______________________________________________
> Babase mailing list
> Babase at www.eco.princeton.edu
> http://www.eco.princeton.edu/mailman/listinfo/babase
-----------------------------------------------
Susan Alberts, Dept. Biology, Duke University, Durham NC 27708. Phone
919-660-7272, Fax 919-660-7293. alberts at duke.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eco.princeton.edu/pipermail/babase/attachments/20070222/03b0ae18/attachment-0001.html
More information about the Babase
mailing list