When we get message similar as below, usually we did not indicate a table for that column. But sometimes it means you have written the same thing twice in select statement and you need to check if you are selecting the same column twice in the same select statement.
‘Statement 1 is not valid. ERROR: column reference “type” is ambiguous’