Re: ALTER TABLE ( smallinto -> boolean ) ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE ( smallinto -> boolean ) ...
Date
Msg-id 6399.1125608205@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE ( smallinto -> boolean ) ...  ("Marc G. Fournier" <scrappy@postgresql.org>)
Responses Re: ALTER TABLE ( smallinto -> boolean ) ...
List pgsql-hackers
"Marc G. Fournier" <scrappy@postgresql.org> writes:
> On Mon, 29 Aug 2005, Tom Lane wrote:
>> No, because there's no built-in cast from smallint to bool.

> 'k, I just took a read through the "CREATE CAST" man page, and don't think 
> I can use that for this,

Sure you can.  Make a SQL or PLPGSQL function that does the conversion
you want and then create a cast using it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: ALTER TABLE ( smallinto -> boolean ) ...
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Using multi-locale support in glibc