Hello, I'm hoping someone might be able to shed a little light on a strange situation I encountered recently.
--
I work with a postgres instance which has dozens (probably hundreds) of tables which each have a column defined as "uuid primary key default gen_random_uuid()".
Most of the time this is fine, but one specific table has recently started repeatedly having inserts fail because of a unique constraint violation involving the primary key. The table only has ~10,000 rows, but I'll sometimes see two or three collisions in a single day. No other table (even those with many, many more rows) exhibit this issue.
We're running postgres 12, so I believe the gen_random_uuid function is provided by the pgcrypto extension, but either way it'll be the same for that entire database instance, so I can't explain why only one table would be having problems if it were due to a bug in the function. Also, since I believe it just uses openssl (which we have linked) to generate random bytes, the chance of a bug should be very low.
Anyone have any thoughts on this?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d- s+ a- C++++ L+++ S++ B+ P++>++++ E++ W+++
N o? K- !w++++ O- M- V? PS++ PE- Y+ PGP t+ 5+++
X R+ tv b+++ DI++ D++ G+ e-- h- r++ y
------END GEEK CODE BLOCK------
Version: 3.12
GIT d- s+ a- C++++ L+++ S++ B+ P++>++++ E++ W+++
N o? K- !w++++ O- M- V? PS++ PE- Y+ PGP t+ 5+++
X R+ tv b+++ DI++ D++ G+ e-- h- r++ y
------END GEEK CODE BLOCK------