hsivonen wrote:
I have DB rows / persistent objects that represent users and groups. The primary key is the login name or group name. There are foreign key references to these tables from elsewhere. When either the login name of a user or a group name changes, it is necessary to update the same DB row and have the change cascade to the references. Creating a new row would break the references.
Changing primary keys is a bad thing to do and should not be done often. It should be far easier to use a little bit of SQL in a separate system (i.e. psql) to make these hopefully infrequent changes.
If these changes are frequent then it may be necessary to rethink your design (if possible).