Implement real_primary_key for broken databases
Extend real primary key support for lookup databases