How to share a unique value between tables efficiently [postgres]
Use bigint values generated by a single sequence. Numbers are quite easy to say over the telephone.
Forget about the requirement of enforcing database-wide uniqueness. Unless someone manually messes with the data, the sequence will guarantee the requirement. The performance cost of enforcing such a requirement with database means would greatly outweigh its usefulness.
An alternative would be to have a unique alphabetic prefix for each table that you store in a &quot;table of tables&quot;. Then each table has its own sequence, and you generate the primary key in a BEFORE INSERT trigger by concatenating the table's prefix with the sequence value. That would be slighly more expensive, but would lead to more pronouncable names.