Re: minor problem in boolean cast - Mailing list pgsql-hackers

From Tom Lane
Subject Re: minor problem in boolean cast
Date
Msg-id 280256.1603497875@sss.pgh.pa.us
Whole thread Raw
In response to minor problem in boolean cast  (Cary Huang <cary.huang@highgo.ca>)
List pgsql-hackers
Cary Huang <cary.huang@highgo.ca> writes:
> I noticed that when casting a string to boolean value with input 'of' it still cast it to 'f'. I think with 'of', it
shouldgive an error because 'off' is the expected candidate. This may not be intended so I made a simple patch to
addressthis.  

It's absolutely intended, and documented:

https://www.postgresql.org/docs/devel/datatype-boolean.html

Note the bit about "Unique prefixes of these strings are also accepted".

The code comment just above parse_bool() says the same.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: speed up unicode decomposition and recomposition
Next
From: Tom Lane
Date:
Subject: Re: speed up unicode decomposition and recomposition