Re: BUG #17258: Unexpected results in CHAR(1) data type
От
Mark Dilger
Тема
Re: BUG #17258: Unexpected results in CHAR(1) data type
Дата
Msg-id
B7220689-0307-46C5-A65D-3BD60DA364B4@enterprisedb.com
Ответ на
Re: BUG #17258: Unexpected results in CHAR(1) data type (David G. Johnston)
Список
Дерево обсуждения
BUG #17258: Unexpected results in CHAR(1) data type PG Bug reporting form <noreply@postgresql.org>
Re: BUG #17258: Unexpected results in CHAR(1) data type Mark Dilger <mark.dilger@enterprisedb.com>
Re: BUG #17258: Unexpected results in CHAR(1) data type "David G. Johnston" <david.g.johnston@gmail.com>
> On Oct 29, 2021, at 3:13 PM, David G. Johnston wrote: > > For practical purposes you will frequently hit the one bit or the other. > > > As I noted in a prior reply, octet_length(char) does the length computation with the padding spaces. So it is possible for char input functions to do the expected thing. Yes, I saw that. But there aren't that many functions like octet_length that do so. If users coming from other RDBMSs expect CHAR(1) to behave as David expects them to behave, it's cold comfort to say, "hang in there, you can still use octet_length() on them!" Better to say that they are going to be bitten by this expectation again and again, and instead choose a different datatype (which you also said.) — Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-bugs по дате отправления
От: David G. Johnston
Дата:
От: Andres Freund
Дата: