Re: [bug] Wrong bool value parameter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wenjing <wjzeng2012(at)gmail(dot)com>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Euler Taveira <euler(dot)taveira(at)2ndquadrant(dot)com>, 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-11 15:25:13
Message-ID: 27959.1586618713@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

wenjing <wjzeng2012(at)gmail(dot)com> writes:
> 2020年4月7日 22:35,Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com> 写道:
>>> 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.

> It seems difficult to store a new bool value in parse_one_reloption. This is a string stored with ”autovacuum_enabled =“.
> any other ideas?

I don't think we should touch this. If the user chose to write the value
in a specific way, they might've had a reason for that. There's little
reason for us to override it, certainly not enough to justify introducing
a lot of new mechanism just to do that.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tomas Vondra 2020-04-11 18:35:52 Re: BUG #16112: large, unexpected memory consumption
Previous Message wenjing 2020-04-11 15:05:17 Re: [bug] Wrong bool value parameter

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2020-04-11 16:13:08 Re: cleaning perl code
Previous Message Tom Lane 2020-04-11 15:14:52 Re: cleaning perl code