copy works, \copy doesn't

Поиск
Список
Период
Сортировка
От Paul Buder
Тема copy works, \copy doesn't
Дата
Msg-id Pine.LNX.4.44.0211091024350.18938-101000@shell1.aracnet.com
обсуждение исходный текст
Ответы Re: copy works, \copy doesn't  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
It seems the psql \copy command doesn't work properly when dealing
with certain non-ascii characters (which ones I don't know).  At any rate
I took some binary data and escaped it like so with perl.

$text=~s/\\/\\\\/g;
$text=~s/\n/\\\n/g;
$text=~s/\t/\\\t/g;


In other words I escaped escape characters, newlines and tabs.

I made a table like this
CREATE TABLE "testtable" (
    "somenumber" integer DEFAULT '0' NOT NULL,
    "sometext" text DEFAULT '' NOT NULL
);

I made my input file by printing out a asciified number, a tab,
the text above and a newline.  This is the attached file.
In the event attached files get stripped by the mailing list it
is also at http://www.aracnet.com/~paulb/sample-data


When I do
copy testtable from '/home/paulb/sample-data';
it works fine.

When I do
\copy testtable from '/home/paulb/sample-data'
I get ERROR:  copy: line 2, pg_atoi: error in "(binary gobbledygook)

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Nick Howden
Дата:
Сообщение: Possible bug in query planner when using DISTINCT
Следующее
От: Oliver Fänger
Дата:
Сообщение: rpmbuild postgresql-7.2.3 fails for perl modules manpages