Thread: import from tsv
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:ERROR: COPY delimiter must be a single one-byte character
" ...DELIMITER E'\\t' ..."
I ran it again as csv instead of text, but still with the tab delimiter, same result.
ERROR: syntax error at or near "'/usr/lib/postgresql/9.4/bin/
Thanks for reporting.
Issue has been logged.
Thanks,
Neel Patel
On Mon, Nov 7, 2016 at 10:37 AM, Malik Rumi <malik.a.rumi@gmail.com> wrote:
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.Another syntax error. Just for the hell of it, I ran the prepended backslash with both double and single quotes, none of which worked.No quotes, single quotes, and double quotes all failed, so I decided to prepend a backslash to the path:I tried again with the path double quoted, and this time I got a plain old error, no success, and no data.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.Ok, I did that (single quotes) but I got this ambiguous message back:Now I get a syntax error at 'usr', so maybe it needs that in quotes.Ok, I took that out.Besides, how would I make [tab], '\t', or '\\t' single byte code?So the delimiter PGAdmin4 is choking on is the delimiter it chose to use. All I did was select from a drop down.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:Above that, where it spells out the actual SQL code that was run, there is:
ERROR: COPY delimiter must be a single one-byte character
" ...DELIMITER E'\\t' ..."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.
ERROR: syntax error at or near "'/usr/lib/postgresql/9.4/bin/psql'" LINE 1: '/usr/lib/postgresql/9.4/bin/p sql' --host "localhost" --port... ^ Query returned successfully in 114 msec.