Comment 8 for bug 897098

Revision history for this message
Kelbethor (csi-kelbethor) wrote : Re: problem after restore: there is no primary key for referenced table "res_users"

I don't know if this could be dangerous, it worked for me as a workarroud...

As postgres or database owner run this:
"for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" DATABASE_NAME` ; do psql -c "alter table $tbl ADD CONSTRAINT "$tbl"_pkey PRIMARY KEY (id);" DATABASE_NAME ; done"

I repeat, I think it's really dangerous, you'd better filter more accurate tables to alter...