Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123
Date: 2021-02-17 02:08:36
Message-ID: CA+hUKGLBLAL28XqmgPe=qEourgQBd++7RdS_u7o5FwJBenRcJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 18, 2021 at 11:22 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)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.

Attachment Content-Type Size
0001-Improve-error-message-for-pg_collation_actual_versio.patch text/x-patch 5.0 KB
0002-pg_collation_actual_version-pg_collation_current_ver.patch text/x-patch 6.2 KB
0003-Refactor-get_collation_current_version.patch text/x-patch 2.7 KB
0004-Tab-complete-CREATE-COLLATION.patch text/x-patch 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-02-17 02:20:26 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Greg Nancarrow 2021-02-17 01:44:15 Re: Parallel INSERT (INTO ... SELECT ...)