Re: 'true'::TEXT::BOOLEAN

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Markus Bertheau ??? <twanger(at)bluetwanger(dot)de>
Cc: Michael Glaesemann <grzm(at)myrealbox(dot)com>, PostgreSQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: 'true'::TEXT::BOOLEAN
Date: 2005-06-03 15:11:25
Message-ID: 20050603151125.GA10971@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Jun 03, 2005 at 14:23:37 +0200,
Markus Bertheau ??? <twanger(at)bluetwanger(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-06-03 15:15:48 Re: using a selected row as a function parameter
Previous Message Ami Ganguli 2005-06-03 14:44:59 using a selected row as a function parameter