Re: 'true'::TEXT::BOOLEAN doesn't work - Mailing list pgsql-sql

From Markus Bertheau ☭
Subject Re: 'true'::TEXT::BOOLEAN doesn't work
Date
Msg-id 1117806239.9816.39.camel@dicaprio.akademie1.de
Whole thread Raw
In response to Re: 'true'::TEXT::BOOLEAN  (Markus Bertheau ☭ <twanger@bluetwanger.de>)
List pgsql-sql
В Птн, 03/06/2005 в 15:07 +0200, Markus Bertheau ☭ пишет:
> В Птн, 03/06/2005 в 15:46 +0300, Achilleus Mantzios пишет:
> 
> > Also according to the docs:
> > http://www.postgresql.org/docs/current/static/datatype-boolean.html
> > 
> > "Tip: Values of the boolean type cannot be cast directly to other types 
> > (e.g., CAST (boolval AS integer) does not work). This can be accomplished 
> > using the CASE expression: CASE WHEN boolval THEN 'value if true' ELSE 
> > 'value if false' END."
> 
> Ah, that works. Thanks very much.

Correcting myself, that doesn't work. It says something along the lines
of case expression must be of type boolean.

Markus
-- 
Markus Bertheau ☭ <twanger@bluetwanger.de>



pgsql-sql by date:

Previous
From: Markus Bertheau ☭
Date:
Subject: CASE WHEN foo IS NULL THEN DEFAULT ELSE foo END
Next
From: Tom Lane
Date:
Subject: Re: 'true'::TEXT::BOOLEAN