copy from .. How to get rid of encoding check for bytea coumns

Поиск
Список
Период
Сортировка
От Roman Golis
Тема copy from .. How to get rid of encoding check for bytea coumns
Дата
Msg-id 20120909015520.795a7a0d@mail.aps-cz.cz
обсуждение исходный текст
Ответы Re: copy from .. How to get rid of encoding check for bytea coumns  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список pgsql-general
I am trying to load data into a rather simple table:

CREATE TABLE "public"."files" (
  "id" SERIAL,
  "idchar" CHAR(32) NOT NULL,
  "content" BYTEA,
  CONSTRAINT "files_pkey" PRIMARY KEY("id")
) WITHOUT OIDS;

with this command:

copy files (idchar, content) from '/data/1.dat' delimiter '|';

The database encoding is UTF-8.

Here is an example of the data file content:

0C2CCE6941194369B020000B616F1301|\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46\x00\x01

And I get this error:

ERROR:  invalid byte sequence for encoding "UTF8": 0xff

The command

set client_encoding = 'SQL_ASCII';

Does not helps at all, the result is the same error message.

How can I turn off that annoying codepage checking during COPY FROM ?

Isn't it a bug ?

In my humble opinion, tt definitely should not check the encoding for columns of type bytea.

Cheers, R.G.



Disclaimer: http://www.aps-holding.com/disclaimer.html

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

Предыдущее
От: Bret Stern
Дата:
Сообщение: Re: Add a check an a array column
Следующее
От: Herouth Maoz
Дата:
Сообщение: Index creation takes more time?