You should look at http://www.postgresql.org/docs/8.1/static/functions-aggregate.html for aggregate functions.
I guess max should do the work
EDIT: Working example
select id, max(col1), max(col2) from (
select 1 as id, null as col1, 'test' as col2
union
select 1 as id ,'blah' as col1, null as col2
) x group by id