Simple join in postgresql
Don't join tables like that. Using a comma means cross joining tables (cartesian product).

select j.location_id 
from companies c 
   join jobs j on j.company_id = c.id
and c.name = 'name'


These two queries should produce the same execution plan and therefore the same results but this one is much clearer.