From 8811d910a5472fddf2bd1e4f7f40f1e0ff9761b5 Mon Sep 17 00:00:00 2001 From: gindibay Date: Fri, 27 Oct 2023 10:28:09 +0300 Subject: [PATCH] Fixes pg 14 compile errors --- src/backend/distributed/commands/database.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/backend/distributed/commands/database.c b/src/backend/distributed/commands/database.c index 33b8f6a51..c33afb77e 100644 --- a/src/backend/distributed/commands/database.c +++ b/src/backend/distributed/commands/database.c @@ -465,7 +465,6 @@ static DatabaseCollationInfo GetDatabaseCollation(Oid db_oid) { DatabaseCollationInfo info; - Datum collationDatum, ctypeDatum, icuLocaleDatum, collverDatum; bool isNull; Snapshot snapshot = RegisterSnapshot(GetLatestSnapshot()); @@ -477,7 +476,7 @@ GetDatabaseCollation(Oid db_oid) } TupleDesc tupdesc = RelationGetDescr(rel); - collationDatum = heap_getattr(tup, Anum_pg_database_datcollate, tupdesc, &isNull); + Datum collationDatum = heap_getattr(tup, Anum_pg_database_datcollate, tupdesc, &isNull); if (isNull) { info.collation = NULL; @@ -487,7 +486,7 @@ GetDatabaseCollation(Oid db_oid) info.collation = TextDatumGetCString(collationDatum); } - ctypeDatum = heap_getattr(tup, Anum_pg_database_datctype, tupdesc, &isNull); + Datum ctypeDatum = heap_getattr(tup, Anum_pg_database_datctype, tupdesc, &isNull); if (isNull) { info.ctype = NULL; @@ -499,7 +498,7 @@ GetDatabaseCollation(Oid db_oid) #if PG_VERSION_NUM >= PG_VERSION_15 - icuLocaleDatum = heap_getattr(tup, Anum_pg_database_daticulocale, tupdesc, &isNull); + Datum icuLocaleDatum = heap_getattr(tup, Anum_pg_database_daticulocale, tupdesc, &isNull); if (isNull) { info.icu_locale = NULL; @@ -509,7 +508,7 @@ GetDatabaseCollation(Oid db_oid) info.icu_locale = TextDatumGetCString(icuLocaleDatum); } - collverDatum = heap_getattr(tup, Anum_pg_database_datcollversion, tupdesc, &isNull); + Datum collverDatum = heap_getattr(tup, Anum_pg_database_datcollversion, tupdesc, &isNull); if (isNull) { info.collversion = NULL; @@ -539,13 +538,15 @@ FreeDatabaseCollationInfo(DatabaseCollationInfo collInfo) { pfree(collInfo.ctype); } + #if PG_VERSION_NUM >= PG_VERSION_15 if (collInfo.icu_locale != NULL) { pfree(collInfo.icu_locale); } + #endif } - +#if PG_VERSION_NUM >= PG_VERSION_15 static char * get_locale_provider_string(char datlocprovider) { @@ -570,6 +571,7 @@ get_locale_provider_string(char datlocprovider) return ""; } } +#endif /*