4 ms·
TFA says "First of all, there is ONE global sequence for all tables, which means that all IDs across the entirety of the systems are unique", that does sound li
by nightpool 2y ago
TFA says "First of all, there is ONE global sequence for all tables, which means that all IDs across the entirety of the systems are unique", that does sound like "IDs are guaranteed unique across table", no? Maybe there's some gotcha there?
- mattashii 2y agoThat relies on the ID generation to be unique, rather than unique constraints. E.g. INSERT INTO t_country (id, name) VALUES (1, 'NL') is valid and would not fail in the demonstrated database, but it would result in multiple rows when querying SELECT FROM t_global g WHERE g.id = 1. A user inserting their own values or resetting the sequence would not necessarily cause immediate unique constraint faulures while duplicate IDs are routed into inherited tables that don't already contain that ID.
- nightpool 2y agoscary! definitely a really dangerous footgun and I'm not surprised nobody recommends it.