pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: wenjing <wjzeng2012@gmail.com>
Cc: Euler Taveira <euler.taveira@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org, tushar <tushar.ahuja@enterprisedb.com>
Cc: Prabhat Sahu <prabhat.sahu@enterprisedb.com>
Subject: Re: [bug] Wrong bool value parameter
Date: Wed, 08 Apr 2020 09:45:18 -0400
Message-ID: <3414.1586353518@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+fd4k6rYwr33+Hf4aWmAdMDUT4iWjDmQV9aM6-o5AB5CScmsQ@mail.gmail.com>
References: <C6E8C2E7-1906-4F6E-BCC8-7D9FC2FC5CFE@gmail.com>
	<CAH503wA1_burFuRPQkBfMdHXQoc_13R6wmQ06LkjfKN1SHQpSQ@mail.gmail.com>
	<CA+fd4k7zmTWzmZP6xPey=KZ2EtBOY+T6mnrLewjL4XV=n0s+og@mail.gmail.com>
	<C930FB4B-E89A-4608-B30C-2434EBF1FBC3@gmail.com>
	<CA+fd4k6rYwr33+Hf4aWmAdMDUT4iWjDmQV9aM6-o5AB5CScmsQ@mail.gmail.com>

Masahiko Sawada <masahiko.sawada@2ndquadrant.com> writes:
> On Wed, 8 Apr 2020 at 16:00, wenjing <wjzeng2012@gmail.com> wrote:
>> Why do table parameters of a bool type have different rules than data types of a Boolean type?
>> postgres=# 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=# select 'fa'::bool;
 bool 
------
 f
(1 row)

regression=# 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





view thread (9+ messages)  latest in thread

Message-ID: <3414.1586353518@sss.pgh.pa.us>
Permalink:  ../3414.1586353518@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3414.1586353518@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, masahiko.sawada@2ndquadrant.com, wjzeng2012@gmail.com, euler.taveira@2ndquadrant.com, tushar.ahuja@enterprisedb.com, prabhat.sahu@enterprisedb.com
  Subject: Re: [bug] Wrong bool value parameter
  In-Reply-To: <3414.1586353518@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox