osm_id is only unique within element types in OSM database (but not in osm2pgsql schema, see the comment from pnorman below). So the same osm_id can apply to a node, a way and a relation. That's why osm2pgsql polygon table changes the sign of the relation id when it comes from relations and the original positive way id when it comes from simple closed ways.