Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNHhM-0005c5-Ng for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Apr 2020 15:05:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jNHhL-0003dN-AJ for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Apr 2020 15:05:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jNHhL-0003dG-1y for pgsql-bugs@lists.postgresql.org; Sat, 11 Apr 2020 15:05:31 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jNHhH-0008CP-DY for pgsql-bugs@lists.postgresql.org; Sat, 11 Apr 2020 15:05:30 +0000 Received: by mail-pg1-x544.google.com with SMTP id g32so2299715pgb.6 for ; Sat, 11 Apr 2020 08:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xJuc14MrAH2xRQHSAqV4zTFquCJSKn+sZb5X3uqZK4Q=; b=KZlNsN3yrodxfY8fVw9KT4qn0CXs/OPc0F2GgHgbEc8eqBRRQl0P/K3XnxJVtb4eh/ FfglG2azfdf3T9PBY0aRzb7uShRGX0LecNR6wOjMW+ZvyB7HASINEXctncUbyhqY4nJh VfouMBpVfjiKn7OU3ySq0UgVOzTH+s4nXHeisFqZIEB+Fd8/Jf3dKPuZlQ8wJEyuZ37X lnSL/41Iy8NoVWOBaz5t5y8GG7GRxFQBjte5ISlbR4Ik/Y1yGlKGD4nyiXuX7YstvdN9 hFq+VswbtoVEz+GypKtgAO0CKvabw10bsE5Md2yqVRnzgjaJqmnPGeOFU+DVLzfAOyxZ v04Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xJuc14MrAH2xRQHSAqV4zTFquCJSKn+sZb5X3uqZK4Q=; b=C4Iwo4YyOwELdVp7JdgYif6ZWKMFVQeSh+1ECGbMef4j/4u5F4/UpDd8uBIWB9p5Og 3mSGqY87BeD4LyhWdRM80yjN8OHhndoX1wP2+BXEOMzTGZzqJVWh4Dkm0wspGw0I/oSO 3QITaJONeUNcyAiTWAd4cBU9/QoVnNDto7jokZUtgXhgzFAidP6cMU0t8FBeSFd7I6/9 Sol4059cBG0H29nbXt9UzgT5vXUUHfkHB1NWIH96xKp/yggLh1IVESDTZvjTjhiXb3NL 0qZE94m5M1PPy/Ew2mASbBGPeK52WfRxKOzsBlaabkXpg1i1fTPIs5JqapgTuLKjE2NF 7/6A== X-Gm-Message-State: AGi0PuYW4W9B7Kiyz905M6wIe/jSFEtuQd/fQTZAs4OV9lzCbrf6djXn Tv+oHgAT7KChzgLcTy1CQjk= X-Google-Smtp-Source: APiQypIQ3gqIIWM4aUY8q6VR3BkhOxbfE6+Qv1wBWGr2+zrJ5PiqgfmVfsyOoZXg2yyQrdHv9z99IA== X-Received: by 2002:a63:1806:: with SMTP id y6mr2636307pgl.407.1586617525081; Sat, 11 Apr 2020 08:05:25 -0700 (PDT) Received: from [127.0.0.1] ([20.188.0.188]) by smtp.gmail.com with ESMTPSA id i187sm4395706pfc.112.2020.04.11.08.05.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Apr 2020 08:05:24 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [bug] Wrong bool value parameter From: wenjing In-Reply-To: Date: Sat, 11 Apr 2020 23:05:17 +0800 Cc: Euler Taveira , pgsql-bugs@lists.postgresql.org, tushar , Prabhat Sahu Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Masahiko Sawada X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > 2020=E5=B9=B44=E6=9C=887=E6=97=A5 22:35=EF=BC=8CMasahiko Sawada = =E5=86=99=E9=81=93=EF=BC=9A >=20 > On Tue, 7 Apr 2020 at 20:58, Euler Taveira > wrote: >>=20 >> On Tue, 7 Apr 2020 at 06:30, =E6=9B=BE=E6=96=87=E6=97=8C = wrote: >>>=20 >>> Do we allow such a bool parameter value? This seems puzzling to me. >>>=20 >>>=20 >>> postgres=3D# create table t1(c1 int) with(autovacuum_enabled =3D'tr');= >>> CREATE TABLE >>> postgres=3D# create table t2(c1 int) with(autovacuum_enabled =3D'fa');= >>> CREATE TABLE >>> postgres=3D# \d+ t1 >>> Table "public.t1" >>> Column | Type | Collation | Nullable | Default | Storage | Stats = target | Description >>> = --------+---------+-----------+----------+---------+---------+------------= --+------------- >>> c1 | integer | | | | plain | = | >>> Access method: heap >>> Options: autovacuum_enabled=3Dtr >>>=20 >> [don't post to multiple mailing lists] >>=20 >> 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 =E2=80=9Dautovacuum_enabled =3D=E2=80=9C. any other ideas? >>=20 >=20 > The document[1] states: >=20 > Boolean: Values can be written as on, off, true, false, yes, no, 1, 0 > (all case-insensitive) or any unambiguous prefix of one of these. >=20 > Given that PostgreSQL treats such values as boolean values it seems to > me that it's a normal behavior. >=20 > [1] https://www.postgresql.org/docs/devel/config-setting.html >=20 > Regards, >=20 > --=20 > Masahiko Sawada http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services