Comment 7 for bug 897098

Revision history for this message
Nicola Riolini - Micronaet (nicolariolini) wrote : Re: problem after restore: there is no primary key for referenced table "res_users"

Kelbethor,
till now I do a reindex of tables that loose key attribute, so when I see this error, for ex. when I update module, doing some operation etc. I run via psql this query (here a list of broken tables finded in my DB, for now...), HTH:

sudo su - postgres
psql broken_db

alter table res_users add primary key (id);
alter table res_partner add primary key (id);
alter table res_groups add primary key (id);
alter table ir_act_window add primary key (id);
alter table ir_model_fields add primary key (id);
alter table ir_model add primary key (id);
alter table ir_act_report_xml add primary key (id);
alter table ir_values add primary key (id);
alter table wkf add primary key (id);
alter table wkf_activity add primary key (id);
alter table ir_act_server add primary key (id);
alter table ir_attachment add primary key (id);
alter table product_product add primary key (id);