Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbFvl-0004J9-B2 for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Jun 2019 02:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbFvk-00070p-8p for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Jun 2019 02:57:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbFvk-00070f-0w for pgsql-bugs@lists.postgresql.org; Thu, 13 Jun 2019 02:57:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbFvg-0006qQ-Av for pgsql-bugs@lists.postgresql.org; Thu, 13 Jun 2019 02:57:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5D2vSJm005449; Wed, 12 Jun 2019 22:57:28 -0400 From: Tom Lane To: "David G. Johnston" cc: wgyumg@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15836: Casting 'of' to boolean type should throw an invalid input syntax In-reply-to: References: <15836-656fab055735f511@postgresql.org> Comments: In-reply-to "David G. Johnston" message dated "Wed, 05 Jun 2019 14:49:47 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5447.1560394648.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 12 Jun 2019 22:57:28 -0400 Message-ID: <5448.1560394648@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Wed, Jun 5, 2019 at 2:37 PM PG Bug reporting form > wrote: >> Converting 'of' to a boolean type should throw an invalid input syntax. > At this point raising a syntax error is undesirable, but the documentati= on > should be modified to match the source code, which does say: > src/utils/adt/bool.c > * Try to interpret value as boolean value. Valid values are: true, > * false, yes, no, on, off, 1, 0; as well as unique prefixes thereof. > The unique prefix part needs to make it to user-facing documentation. Agreed, the docs are misleading here. I pushed something to try to make it better: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D9= 729c9360886bee7feddc6a1124b0742de4b9f3d regards, tom lane