Re: BUG #11875: char() not behaving as documented

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #11875: char() not behaving as documented
Дата
Msg-id 15515.1415133369@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #11875: char() not behaving as documented  (b.wood@niwa.co.nz)
Список pgsql-bugs
b.wood@niwa.co.nz writes:
> According to the docs
> http://www.postgresql.org/docs/9.3/static/datatype-character.html)(:
> " If the string to be stored is shorter than the declared length, values of
> type character will be space-padded; values of type character varying will
> simply store the shorter string."

Quite.

> Yet chars are not being padded

Yes they are.  You are neglecting the fact that a coercion from char to
varchar/text strips trailing blanks, so that a test like this:

> fish=# select var3||':' as var3, cha3||':' as char3 from test;

proves nothing at all about how many trailing spaces there were in
cha3.

            regards, tom lane

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] COPY TO returning empty result with parallel ALTER TABLE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL 9.3 Segfault in "hstore_to_json" function