Re: insert char(1) type by different ways.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: insert char(1) type by different ways.
Дата
Msg-id 2688.981232432@sss.pgh.pa.us
обсуждение исходный текст
Ответ на insert char(1) type by different ways.  ("And. Andruikhanov" <andy@euinf.dp.ua>)
Ответы Re: insert char(1) type by different ways.  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-bugs
"And. Andruikhanov" <andy@euinf.dp.ua> writes:
> insert into ku values(1, '\000');

This cannot work as you expect, because what comes out of the parser is
a string containing a single null character --- and that's fed to a
datatype input routine that expects a null-terminated string.  So the
char(n) input routine thinks you entered just '', which it blank-pads
to one character.

In general the Postgres I/O routines are not friendly to embedded nulls.
The char/varchar/text types could not support embedded nulls even
without the I/O problem, because they depend on C library routines like
strcoll(), and those routines don't support strings with embedded nulls.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql & "unexpected EOF on client connection"
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: syslog logging setup broken?