Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-02-17T02:08:36Z
Lists: pgsql-hackers
Attachments
- 0001-Improve-error-message-for-pg_collation_actual_versio.patch (text/x-patch) patch 0001
- 0002-pg_collation_actual_version-pg_collation_current_ver.patch (text/x-patch) patch 0002
- 0003-Refactor-get_collation_current_version.patch (text/x-patch) patch 0003
- 0004-Tab-complete-CREATE-COLLATION.patch (text/x-patch) patch 0004
On Mon, Jan 18, 2021 at 11:22 AM Thomas Munro <thomas.munro@gmail.com> wrote: > On Mon, Jan 18, 2021 at 10:59 AM Justin Pryzby > |postgres=# SELECT > pg_collation_actual_version(123); > > |ERROR: cache lookup failed for collation 123 > > Yeah, not a great user experience. Will fix next week; perhaps > get_collation_version_for_oid() needs missing_ok and found flags, or > something like that. Here's a patch that gives: postgres=# select pg_collation_actual_version(123); ERROR: no collation found for OID 123 It's a bit of an odd function, it's user-facing yet deals in OIDs. > I'm also wondering if it would be better to name that thing with > "current" rather than "actual". Here's a patch to do that (note to self: would need a catversion bump). While tidying up around here, I was dissatisfied with the fact that there are three completely different ways of excluding "C[.XXX]" and "POSIX" for three OSes, so here's a patch to merge them. Also, here's the missing tab completion for CREATE COLLATION, since it's rare enough to be easy to forget the incantations required.
Commits
-
Tab-complete CREATE COLLATION.
- 5bc09a74719d 14.0 landed
-
Refactor get_collation_current_version().
- beb4480c853a 14.0 landed
-
pg_collation_actual_version() -> pg_collation_current_version().
- 9cf184cc0599 14.0 landed
-
Hide internal error for pg_collation_actual_version(<bad OID>).
- 0fb0a0503bfc 14.0 landed