Re: BUG #15836: Casting 'of' to boolean type should throw an invalid input syntax

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: wgyumg(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15836: Casting 'of' to boolean type should throw an invalid input syntax
Date: 2019-06-05 21:49:47
Message-ID: CAKFQuwZeQKTrv-r=0SrkSn50jHo0WkxjL7mKt0kxm6JYSkT68w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 5, 2019 at 2:37 PM PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 15836
> Logged by: Yuming Wang
> Email address: wgyumg(at)gmail(dot)com
> PostgreSQL version: 12beta1
> Operating system: linux
> Description:
>
> Converting 'of' to a boolean type should throw an invalid input syntax.
> Because we said in the documentation that 'of' is not accepted as an input
> to the boolean data type:
> https://www.postgresql.org/docs/12/datatype-boolean.html
> ```
> postgres=# select cast('of' as boolean);
> bool
> ------
> f
> (1 row)
> ```
>

At this point raising a syntax error is undesirable, but the documentation
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.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Matthew Bauer 2019-06-06 04:13:40 Test suite fails on macOS after update to 9.6.13 and 11.3
Previous Message PG Bug reporting form 2019-06-05 21:36:48 BUG #15836: Casting 'of' to boolean type should throw an invalid input syntax