Re: 'true'::TEXT::BOOLEAN - Mailing list pgsql-sql

From Bruno Wolff III
Subject Re: 'true'::TEXT::BOOLEAN
Date
Msg-id 20050603151125.GA10971@wolff.to
Whole thread Raw
In response to Re: 'true'::TEXT::BOOLEAN  (Markus Bertheau ☭ <twanger@bluetwanger.de>)
Responses Re: 'true'::TEXT::BOOLEAN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Fri, Jun 03, 2005 at 14:23:37 +0200, Markus Bertheau ??? <twanger@bluetwanger.de> wrote:
> This also bypasses the built in postgresql boolean literal parsing.
> 
> I think casting from text to boolean should be possible, and use the
> same algorithm that's used when casting from "unknown" to boolean.

You probably want boolin.

area=> select boolin('0'), boolin('f'), boolin('false');boolin | boolin | boolin
--------+--------+--------f      | f      | f
(1 row)

Note that the function will error out if the argument is garbage.


pgsql-sql by date:

Previous
From: Ami Ganguli
Date:
Subject: using a selected row as a function parameter
Next
From: Tom Lane
Date:
Subject: Re: using a selected row as a function parameter