How to add PK on every id column in Postgres
You can generate the SQL to add the primary key with:

select concat('ALTER TABLE ',table_schema,'.',table_name,' ADD CONSTRAINT ',
              table_schema,'.pk_',table_name,' PRIMARY KEY (id)')
from   information_schema.columns
where  column_name ='id'
and    table_schema='xxx';


Replace the xxx with the schema for which you want to create the primary keys. You only need to write the output to a file and check and execute it.