CASE WHEN column='t' THEN 1 ELSE 0 ENDOr just CASE WHEN column THEN 1 ELSE 0 END.
In the mean time I've got an elegant solution: alter ... ... column TYPE smallint USING column::boolean::int::smallint; It works, you wouldn't beleive it. ;) Zdravko -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql