Re: [bug] Wrong bool value parameter

From: Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>
To: 曾文旌 <wjzeng2012(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, Prabhat Sahu <prabhat(dot)sahu(at)enterprisedb(dot)com>
Subject: Re: [bug] Wrong bool value parameter
Date: 2020-04-07 11:58:23
Message-ID: CAH503wA1_burFuRPQkBfMdHXQoc_13R6wmQ06LkjfKN1SHQpSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Tue, 7 Apr 2020 at 06:30, 曾文旌 <wjzeng2012(at)gmail(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-04-07 13:00:42 BUG #16347: pgbadger is missing in the repo
Previous Message David Steele 2020-04-07 11:21:58 Re: Don't try fetching future segment of a TLI.

Browse pgsql-hackers by date

  From Date Subject
Next Message Anna Akenteva 2020-04-07 12:07:42 Re: [HACKERS] make async slave to wait for lsn to be replayed
Previous Message David Rowley 2020-04-07 11:52:29 Re: Run-time pruning for ModifyTable