pg_collation_actual_version() ERROR: cache lookup failed for collation 123

Justin Pryzby <pryzby@telsasoft.com>

From: Justin Pryzby <pryzby@telsasoft.com>
To: pgsql-hackers@postgresql.org
Date: 2021-01-17T21:59:40Z
Lists: pgsql-hackers
As of 257836a75, this returns:

|postgres=# SELECT pg_collation_actual_version(123);
|ERROR:  cache lookup failed for collation 123
|postgres=# \errverbose 
|ERROR:  XX000: cache lookup failed for collation 123
|LOCATION:  get_collation_version_for_oid, pg_locale.c:1754

I'm of the impression that's considered to be a bad behavior for SQL accessible
functions.

In v13, it did the same thing but with different language:

|ts=# SELECT pg_collation_actual_version(123);
|ERROR:  collation with OID 123 does not exist
|ts=# \errverbose 
|ERROR:  42704: collation with OID 123 does not exist
|LOCATION:  pg_collation_actual_version, collationcmds.c:367

-- 
Justin



Commits

  1. Tab-complete CREATE COLLATION.

  2. Refactor get_collation_current_version().

  3. pg_collation_actual_version() -> pg_collation_current_version().

  4. Hide internal error for pg_collation_actual_version(<bad OID>).