El 05-02-25 a las 19:13, Michał Kłeczek escribió:
Only if you do not see the primary key as the main immutable value identifying 
an object, entity, you name it.
Surrogate key cannot identify any (real) object by definition :)
What object is identified by PK value 42 in “restaurants” table?
What object is identified by a PK value "löasidfhaösliw" in a restaurant table? It is the context only giving it sense and not less sense then 42 or "Pizza Hut". In fact on disk, you won't even find 42 or "Pizza Hut". On hard disks, e.g., it is the direction of a magnetic field of several locations on the disk. Btw, 42 seems to me a quite geeky name for a nerd restaurant.
Having said that, it is very questionable that a natural key (names to name 
one) can be a suitable primary key (think of typo).
Typos are indeed a problem but adding surrogate key does not solve it, I’m 
afraid.
In how far does it not solve it? Or maybe better asked. Is your problem that typos occur or is the problem the amount of hassle to fix it?



Reply via email to