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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: 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-13 02:57:28
Message-ID: 5448.1560394648@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Wed, Jun 5, 2019 at 2:37 PM PG Bug reporting form <noreply(at)postgresql(dot)org>
> wrote:
>> Converting 'of' to a boolean type should throw an invalid input syntax.

> 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.

Agreed, the docs are misleading here. I pushed something to try to
make it better:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=9729c9360886bee7feddc6a1124b0742de4b9f3d

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-06-13 03:06:44 Re: BUG #15849: (Document) Generated Columns sample code has a strange expression
Previous Message PG Bug reporting form 2019-06-13 02:19:54 BUG #15849: (Document) Generated Columns sample code has a strange expression