import from tsv

From: Malik Rumi <malik(dot)a(dot)rumi(at)gmail(dot)com>
To: pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: import from tsv
Date: 2016-11-07 05:07:45
Message-ID: CAKd6oBwyKY4jd5mz39dxLU11_3w+EBz67dmAXyiBi4u9d9kXZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

I need to import data from a TSV. Using the import dialog and selecting
text as the file format, I can select [tab] from the delimiter drop down.
There is a notice that tab is the default, but apparently no way to leave
that blank, thus accepting the default. I think that might be significant
because this is my error message:

ERROR: COPY delimiter must be a single one-byte character

Above that, where it spells out the actual SQL code that was run, there is:

" ...DELIMITER E'\\t' ..."

So the delimiter PGAdmin4 is choking on is the delimiter it chose to use.
All I did was select from a drop down.

Besides, how would I make [tab], '\t', or '\\t' single byte code?

I ran it again as csv instead of text, but still with the tab delimiter,
same result.

That gave me an idea to put the result into the SQL Query Tool, take out
one \ and see what happens. But now it objects to the / at the start of the
command, which I also didn't put in there.

Ok, I took that out.

Now I get a syntax error at 'usr', so maybe it needs that in quotes.

Ok, I did that (single quotes) but I got this ambiguous message back:

ERROR: syntax error at or near "'/usr/lib/postgresql/9.4/bin/psql'" LINE 1:
'/usr/lib/postgresql/9.4/bin/psql' --host "localhost" --port... ^ Query
returned successfully in 114 msec.

How can it be successful and erroneous at the same time? Best guess, this
is not a 'fatal' error. But it is serious enough. Nothing transferred to my
table.

I tried again with the path double quoted, and this time I got a plain old
error, no success, and no data.

No quotes, single quotes, and double quotes all failed, so I decided to
prepend a backslash to the path:

Another syntax error. Just for the hell of it, I ran the prepended
backslash with both double and single quotes, none of which worked.

So maybe the '\t' with one backslash will work as a single byte character
delimiter, but since I can't get the sql that I got from pgadmin4 to run
for me, I won't know.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message henry.katz 2016-11-07 05:24:24 pgadmin 4.x on centos 6.8
Previous Message Murtuza Zabuawala 2016-11-07 04:57:26 Re: BUG: Cannot add primary key, etc during create table