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 1jMB1b-0006PJ-DX for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Apr 2020 13:45:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMB1a-00048y-3o for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Apr 2020 13:45:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMB1Z-00048r-UE for pgsql-bugs@lists.postgresql.org; Wed, 08 Apr 2020 13:45:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMB1B-0008AS-I8 for pgsql-bugs@lists.postgresql.org; Wed, 08 Apr 2020 13:45:48 +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 038DjIiu003416; Wed, 8 Apr 2020 09:45:18 -0400 From: Tom Lane To: Masahiko Sawada cc: wenjing , Euler Taveira , pgsql-bugs@lists.postgresql.org, tushar , Prabhat Sahu Subject: Re: [bug] Wrong bool value parameter In-reply-to: References: Comments: In-reply-to Masahiko Sawada message dated "Wed, 08 Apr 2020 21:25:59 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3413.1586353518.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 08 Apr 2020 09:45:18 -0400 Message-ID: <3414.1586353518@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Masahiko Sawada writes: > On Wed, 8 Apr 2020 at 16:00, wenjing wrote: >> Why do table parameters of a bool type have different rules than data t= ypes of a Boolean type? >> postgres=3D# insert into test_bool_type values('fals'); >> ERROR: invalid input syntax for type boolean: "fals" >> LINE 1: insert into test_bool_type values('fals'); > Hmm that seems strange. In my environment, both 'tr' and 'fa' are > accepted at least with the current HEAD Yeah, it works for me too: regression=3D# select 'fa'::bool; bool = ------ f (1 row) regression=3D# select 'fals'::bool; bool = ------ f (1 row) > IIUC both bool of SQL data type and bool of GUC parameter type are > using the same function parse_bool_with_len() to parse the input > value. The behavior can vary depending on the environment? parse_bool_with_len is not locale-sensitive for ASCII input. Conceivably its case folding could vary for non-ASCII, but that's not relevant here. I am suspicious that the OP is not using community Postgres. This seems like the kind of thing that EDB might've hacked for better Oracle compatibility, for example. regards, tom lane