Re: 'true'::TEXT::BOOLEAN

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Markus Bertheau ☭ <twanger(at)bluetwanger(dot)de>
Cc: PostgreSQL <pgsql-sql(at)postgresql(dot)org>
Subject: Re: 'true'::TEXT::BOOLEAN
Date: 2005-06-03 12:28:30
Message-ID: D48E9C3D-6E0F-4949-8492-5C2459FA058E@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Jun 3, 2005, at 9:23 PM, Markus Bertheau ☭ 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.

Actually, looking at the system tables, I don't think it is. There
don't appear to be any casts to (or from) boolean. I may be looking
at it wrong, but that's how it appears to me. Corrections, anyone?

select type_source.typname as source, type_target.typname as target
from pg_cast
join pg_type type_source on (castsource = type_source.oid)
join pg_type type_target on (casttarget = type_target.oid)
where type_target.typname = 'bool'
or type_source.typname = 'bool'
order by type_source.typname;

source | target
--------+--------
(0 rows)

This is in v8.0.3

Michael Glaesemann
grzm myrealbox com

PS. Please don't top post.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2005-06-03 12:46:48 Re: 'true'::TEXT::BOOLEAN
Previous Message Markus Bertheau ☭ 2005-06-03 12:23:37 Re: 'true'::TEXT::BOOLEAN