I want to change a primary key and all table rows which reference to this value.
# table master
master_id|name
===============
foo|bar
# table detail
detail
I dont think you can update the Primary key. One possible work around is that you can remove the primary key constraint from the table column. Then update the column value.
Updating the primary key can lead you to some serious problems. But if you still want to do it.
Please refer this Thread.(kevchadders has given a solution.)