From d50e3b1f8d763d51080ca4f6cbaa6818a6472292 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Sun, 8 Nov 2020 20:43:45 +1300 Subject: [PATCH] Fix assertion in collation version lookup. Commit 257836a7 included an assertion that a version lookup routine is not trying to look up "C" or "POSIX", but that case is reachable with the user-facing SQL function pg_collation_actual_version(). Remove the assertion. --- src/backend/utils/adt/pg_locale.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index d5a0169420a..1dfe343b79c 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1731,15 +1731,14 @@ get_collation_actual_version(char collprovider, const char *collcollate) /* * Get provider-specific collation version string for a given collation OID. - * Return NULL if the provider doesn't support versions. + * Return NULL if the provider doesn't support versions, or the collation is + * unversioned (for example "C"). */ char * get_collation_version_for_oid(Oid oid) { HeapTuple tp; - char *version = NULL; - - Assert(oid != C_COLLATION_OID && oid != POSIX_COLLATION_OID); + char *version; if (oid == DEFAULT_COLLATION_OID) { -- 2.30.2