I've been reading up on foreign keys and such for postgres and I noticed that it allows a cascading update for foreign keys.
Well, my question is, when would you need to update the primary key of a row?
Apparently this guy needs to http://www.oreillynet.com/onlamp/blog/2004/10/hey_sql_fans_check_out_foreign.html but I'm not quite understanding how it could ever be useful.
Edit: I see for natural primary keys, how this could be used. But what about technical primary keys? Ones that have no meaning and are almost always auto generated on insert?
Well... we have a lot of primary keys that are defined as a human readable code. Terrible idea, but not much choice in the matter.
It is very very handy to be able to fix that PK, and all dependent records, when someone realizes it is misspelled, or the meaning has changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With