Re: [bug] Wrong bool value parameter

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: [bug] Wrong bool value parameter
Дата
Msg-id CAH503wA1_burFuRPQkBfMdHXQoc_13R6wmQ06LkjfKN1SHQpSQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [bug] Wrong bool value parameter  (Masahiko Sawada <masahiko.sawada@2ndquadrant.com>)
Список pgsql-bugs
On Tue, 7 Apr 2020 at 06:30, 曾文旌 <wjzeng2012@gmail.com> wrote:
Do we allow such a bool parameter value? This seems puzzling to me.


postgres=# create table t1(c1 int) with(autovacuum_enabled ='tr');
CREATE TABLE
postgres=# create table t2(c1 int) with(autovacuum_enabled ='fa');
CREATE TABLE
postgres=# \d+ t1
                                    Table "public.t1"
 Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
--------+---------+-----------+----------+---------+---------+--------------+-------------
 c1     | integer |           |          |         | plain   |              | 
Access method: heap
Options: autovacuum_enabled=tr

[don't post to multiple mailing lists]

I'm not sure it is a bug. It certainly can be an improvement. Code as is does not cause issues although I concur with you that it is at least a strange syntax. It is like this at least since 2009 (commit ba748f7a11e). I'm not sure parse_bool* is the right place to fix it because it could break code. IMHO the problem is that parse_one_reloption() is using the value provided by user; it should test those (abbreviation) conditions and store "true" (for example) as bool value.

Regards,

--
Euler Taveira                 http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Grigory Smolkin
Дата:
Сообщение: Re: Don't try fetching future segment of a TLI.
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16347: pgbadger is missing in the repo