Re: BUG #4007: chr(0) doesn't work anymore

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4007: chr(0) doesn't work anymore
Дата
Msg-id 23476.1204559379@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4007: chr(0) doesn't work anymore  ("Steve Clark" <sclark@netwolves.com>)
Ответы Re: BUG #4007: chr(0) doesn't work anymore  (Steve Clark <sclark@netwolves.com>)
Список pgsql-bugs
"Steve Clark" <sclark@netwolves.com> writes:
> Until 8.3.0 the following worked:
> SELECT coalesce(param_value,chr(0)) from t_system_params where  param_name =
> 'default_unit_key';

It would have "worked" only for rather small values of "work", since
most of the support for type TEXT isn't null-safe.  Try something like
"select chr(0) || 'foo';" for example.  Wouldn't an empty string do what
you want better?

> it now fails with:
> ERROR:  null character not permitted

This is an intentional change and won't be undone, at least not until
TEXT is null-safe, which isn't likely to happen in the foreseeable future.

            regards, tom lane

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

Предыдущее
От: "Steve Clark"
Дата:
Сообщение: BUG #4007: chr(0) doesn't work anymore
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4006: pg_ctl assumes that all config files lie in data_directory