On May 29, 2007, at 15:28 , John D. Burger wrote:

Even ISO country codes are not guaranteed to be stable

I'm not sure where the idea that primary keys must be stable comes from. There's nothing necessarily wrong with updating a primary key. All a primary key does is uniquely identify a row in a table. If that id changes over time, that's fine, as long as the primary key columns continue to uniquely identify each row in the table. SQL even provides ON UPDATE CASCADE to make this convenient. There may be performance arguments against updating a primary key (as the changes need to propagate), but that depends on the needs of a particular (benchmarked and tested) application environment.

Michael Glaesemann
grzm seespotcode net



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to