I think this is a funny bug:
select ('TRUE'::TEXT)::BOOL; bool------ f
but:
select ('TRUE'::varchar(4))::BOOL; bool------ t or
select ('true'::TEXT)::BOOL; bool------ t
My postgresql version:PostgreSQL 8.3.4
Laczi József