Re: BUG #13934: wrong result of split_part with char value

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13934: wrong result of split_part with char value
Дата
Msg-id 9241.1455033340@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #13934: wrong result of split_part with char value  (Joe Conway <mail@joeconway.com>)
Ответы Re: BUG #13934: wrong result of split_part with char value
Список pgsql-bugs
Joe Conway <mail@joeconway.com> writes:
> In other words, when you insert ' ' into string1postgres.a3pattern,
> which is defined as char(15), the single space is trimmed leaving an
> empty string:

> test=# select '***' || a3pattern || '!!!' from string1postgres;
>  ?column?
> ----------
>  ***!!!
> (1 row)

Actually, I believe the space-trimming happens when the char(n) value
is coerced to type text in preparation for passing it to the || operator
(which takes text).  Since trailing spaces are considered insignificant
in char(n), whereas they definitely are significant in text, this is a
reasonable thing to do, at least in some contexts.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13937: 'src' -> jsonb_each() -> jsonb_object() -> 'dst' does not recreate 'src' as valid jsonb
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #13934: wrong result of split_part with char value