Re: [bug] Wrong bool value parameter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [bug] Wrong bool value parameter
Дата
Msg-id 3414.1586353518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [bug] Wrong bool value parameter  (Masahiko Sawada <masahiko.sawada@2ndquadrant.com>)
Ответы Re: [bug] Wrong bool value parameter  (wenjing <wjzeng2012@gmail.com>)
Список pgsql-bugs
Masahiko Sawada <masahiko.sawada@2ndquadrant.com> writes:
> On Wed, 8 Apr 2020 at 16:00, wenjing <wjzeng2012@gmail.com> wrote:
>> Why do table parameters of a bool type have different rules than data types of a Boolean type?
>> postgres=# insert into test_bool_type values('fals');
>> ERROR:  invalid input syntax for type boolean: "fals"
>> LINE 1: insert into test_bool_type values('fals');

> Hmm that seems strange. In my environment, both 'tr' and 'fa' are
> accepted at least with the current HEAD

Yeah, it works for me too:

regression=# select 'fa'::bool;
 bool
------
 f
(1 row)

regression=# select 'fals'::bool;
 bool
------
 f
(1 row)

> IIUC both bool of SQL data type and bool of GUC parameter type are
> using the same function parse_bool_with_len() to parse the input
> value. The behavior can vary depending on the environment?

parse_bool_with_len is not locale-sensitive for ASCII input.
Conceivably its case folding could vary for non-ASCII, but that's
not relevant here.

I am suspicious that the OP is not using community Postgres.
This seems like the kind of thing that EDB might've hacked
for better Oracle compatibility, for example.

            regards, tom lane



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

Предыдущее
От: Jehan-Guillaume de Rorthais
Дата:
Сообщение: Re: [BUG] non archived WAL removed during production crash recovery
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: BUG #16351: PostgreSQL closing connection during requests withsegmentation fault