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

From Tom Lane
Subject Re: 'true'::TEXT::BOOLEAN
Date
Msg-id 4300.1117806431@sss.pgh.pa.us
Whole thread Raw
In response to Re: 'true'::TEXT::BOOLEAN  (Markus Bertheau ☭ <twanger@bluetwanger.de>)
List pgsql-sql
Markus Bertheau ☭ <twanger@bluetwanger.de> writes:
> Well, that's not my question. I have a plpgsql function like that:
> ...
> And I can't call it with a TEXT variable, because casting from TEXT to
> BOOLEAN isn't possible.

In plpgsql it is: just assign the text value to a boolean variable.
plpgsql's notions of type safety are pretty lax ;-)
        regards, tom lane


pgsql-sql by date:

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