On 04/05/2007 21:34, Scott Ribe wrote:
> Just discovered (the hard way) that casting a boolean column ::varchar
> doesn't work. I assume I can add a function somewhere that will define a
> default cast for this? Are there any other standard types that can't be cast
I just use something like this:
create or replace function bool2str(TheValue boolean)
returns varchar as
$$
begin
if TheValue then
return 'true';
else
return 'false';
end if;
end;
$$
language plpgsql stable;
Ray.
---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------