I the short term you may use OID as your key and just hide the OID column in your app. You should throw a unique index on OID. And set the driver option to show OID.
pgsql-interfaces by date:
Соглашаюсь с условиями обработки персональных данных