From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Markus Bertheau ??? <twanger@bluetwanger.de>
Cc: Michael Glaesemann <grzm@myrealbox.com>
Cc: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: 'true'::TEXT::BOOLEAN
Date: Fri, 03 Jun 2005 11:28:02 -0400
Message-ID: <5276.1117812482@sss.pgh.pa.us> (raw)
In-Reply-To: <20050603151125.GA10971@wolff.to>
References: <Pine.LNX.4.44.0506031420340.23350-100000@matrix.gatewaynet.com>
<1117799555.9816.24.camel@dicaprio.akademie1.de>
<3DCEDE55-9D4A-4F4E-8907-ADCC058A3398@myrealbox.com>
<1117801417.9816.28.camel@dicaprio.akademie1.de>
<20050603151125.GA10971@wolff.to>
Bruno Wolff III <bruno@wolff.to> writes:
> Markus Bertheau ??? <twanger@bluetwanger.de> wrote:
>> 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.
That won't actually work either, because boolin wants cstring:
egression=# select boolin('f'::text);
ERROR: function boolin(text) does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
You can get it to work like this, if you're determined:
regression=# select boolin(textout('f'::text));
boolin
--------
f
(1 row)
and of course
regression=# select textin(boolout(true));
textin
--------
t
(1 row)
There's been discussion of allowing all datatypes to be explicitly
casted to or from text by generating conversions like these
automatically. But I'm not sure if everyone's convinced it's a good
idea or not. You'd also have to argue about whether varchar should
be included in the special dispensation ...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, twanger@bluetwanger.de, grzm@myrealbox.com
Subject: Re: 'true'::TEXT::BOOLEAN
In-Reply-To: <5276.1117812482@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox