Re: minor problem in boolean cast

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Cary Huang <cary(dot)huang(at)highgo(dot)ca>
Cc: "Pgsql Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minor problem in boolean cast
Date: 2020-10-24 00:04:35
Message-ID: 280256.1603497875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Cary Huang <cary(dot)huang(at)highgo(dot)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 should give an error because 'off' is the expected candidate. This may not be intended so I made a simple patch to address this. 

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-10-24 00:24:06 Re: speed up unicode decomposition and recomposition
Previous Message Michael Paquier 2020-10-24 00:02:52 Re: speed up unicode decomposition and recomposition