5 ms·
That 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 fa
by mattashii 2y ago
That 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.