Mea Culpa on Those Surrogate Keys

Josh Berkus gripes about a common problem in todays software… abuse and misunderstanding of [http://en.wikipedia.org/wiki/Surrogate_key surrogate keys]. Given that I used a bunch of them in the [http://www.amazon.com/exec/obidos/tg/detail/-/1590595475/ref=pd_ts_b_241782/002-8194953-8241647?v=glance&s=books php/pg book], I better provide [http://blogs.ittoolbox.com/database/soup/archives/007327.asp?rss=1 a pointer to his article]. In my defense I did protest a little bit, but for example code it tends to make things easier to mess around with, so I didn’t really try to fight it. What is interesting is that in [http://www.postgresql.org PostgreSQL], the [http://www.postgresql.org/docs/faqs.FAQ.html#item4.12 OID] was really more of a true surrogate key than the [http://www.postgresql.org/docs/current/static/datatype.html#DATATYPE-SERIAL serial datatype], which has become more popular and powerful as PostgreSQL has started being used by more industry types rather than [http://www.dbdebunk.com/index.html academics] (for lack of a better word). But I guess that’s all water under the bridge now… what you can do though is go read his post and then at least add additional [http://www.postgresql.org/docs/8.1/interactive/ddl-constraints.html#AEN2016 unique constraints] to your tables for the columns that really do define a unique row.