Skip to content

Commit d50e3b1

Browse files
committed
Fix assertion in collation version lookup.
Commit 257836a 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.
1 parent 8cff66d commit d50e3b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/backend/utils/adt/pg_locale.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -1731,15 +1731,14 @@ get_collation_actual_version(char collprovider, const char *collcollate)
17311731

17321732
/*
17331733
* Get provider-specific collation version string for a given collation OID.
1734-
* Return NULL if the provider doesn't support versions.
1734+
* Return NULL if the provider doesn't support versions, or the collation is
1735+
* unversioned (for example "C").
17351736
*/
17361737
char *
17371738
get_collation_version_for_oid(Oid oid)
17381739
{
17391740
HeapTuple tp;
1740-
char *version = NULL;
1741-
1742-
Assert(oid != C_COLLATION_OID && oid != POSIX_COLLATION_OID);
1741+
char *version;
17431742

17441743
if (oid == DEFAULT_COLLATION_OID)
17451744
{

0 commit comments

Comments
 (0)