Change primary key value

For some reason I have it in my head that changing the value of the Primary Key is a NO NO.

Like an SSN that was typed in error, and record saved to the DB, then later corrected and re-saved.

I had the idea that your had to delete the incorrect record then save a new corrected record.

Which is it?

The only constraint on a Primary Key is that is MUST be unique to the table
So you can change the field, as long as the new value does not violate this constraint.

Thanks Dave

Just watch out if it is used as foreign key in another table/

This is why I prefer artificial primary keys over using a “natural” primary key. If you have any table relationships at all, changing the primary key could result in a data integrity nightmare.