Thanks for pointing me to the discussion. I’ve read the thread and would suggest applying the doc-note, that’s in the last part of that discussion:
Small doc tweak suggestion - the pgcrypto docs [1] now say about gen_random_uuid():
Returns a version 4 (random) UUID. (Obsolete, this function is now also included in core PostgreSQL.)
which gives the impression the code contains two versions of this function, the core one and an obsolete one in pgcrypto. Per the commit message the situation is actually:
The pgcrypto implementation now internally redirects to the built-in one.
That would have avoided this bug-report I guess, as the documentation would reflect the actual situation better.
pg_crypto's gen_random_uuid() is now just a wrapper for the core function. Taking it out entirely would save only a couple lines of code.
If you install the pgcrypto-extension in the pg_catalog-schema (yes, I'm aware if installing it in public the error doesn't occur) you get an error:
The contrary side of that is that taking it out of the extension could break applications that expect gen_random_uuid() to exist in the extension's schema. I don't think we consider installing extensions in pg_catalog to be a supported case, anyway.