mirror of https://github.com/citusdata/citus.git
Adds icu_rules in meta_data sync
parent
fcdea98edd
commit
b5388ddf92
|
@ -52,8 +52,9 @@ typedef struct DatabaseCollationInfo
|
||||||
char *collation;
|
char *collation;
|
||||||
char *ctype;
|
char *ctype;
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_15
|
#if PG_VERSION_NUM >= PG_VERSION_15
|
||||||
char *icu_locale;
|
char *icuLocale;
|
||||||
char *collversion;
|
char *collversion;
|
||||||
|
char *icuRules;
|
||||||
#endif
|
#endif
|
||||||
} DatabaseCollationInfo;
|
} DatabaseCollationInfo;
|
||||||
|
|
||||||
|
@ -529,11 +530,11 @@ GetDatabaseCollation(Oid dbOid)
|
||||||
&isNull);
|
&isNull);
|
||||||
if (isNull)
|
if (isNull)
|
||||||
{
|
{
|
||||||
info.icu_locale = NULL;
|
info.icuLocale = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info.icu_locale = TextDatumGetCString(icuLocaleDatum);
|
info.icuLocale = TextDatumGetCString(icuLocaleDatum);
|
||||||
}
|
}
|
||||||
|
|
||||||
Datum collverDatum = heap_getattr(tup, Anum_pg_database_datcollversion, tupdesc,
|
Datum collverDatum = heap_getattr(tup, Anum_pg_database_datcollversion, tupdesc,
|
||||||
|
@ -548,6 +549,20 @@ GetDatabaseCollation(Oid dbOid)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||||
|
Datum icuRulesDatum = heap_getattr(tup, Anum_pg_database_daticurules, tupdesc,
|
||||||
|
&isNull);
|
||||||
|
|
||||||
|
if (isNull)
|
||||||
|
{
|
||||||
|
info.icuRules = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info.icuRules = TextDatumGetCString(icuRulesDatum);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
table_close(rel, AccessShareLock);
|
table_close(rel, AccessShareLock);
|
||||||
UnregisterSnapshot(snapshot);
|
UnregisterSnapshot(snapshot);
|
||||||
heap_freetuple(tup);
|
heap_freetuple(tup);
|
||||||
|
@ -630,10 +645,10 @@ GenerateCreateDatabaseStatementFromPgDatabase(Form_pg_database databaseForm)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_15
|
#if PG_VERSION_NUM >= PG_VERSION_15
|
||||||
if (collInfo.icu_locale != NULL)
|
if (collInfo.icuLocale != NULL)
|
||||||
{
|
{
|
||||||
appendStringInfo(&str, " ICU_LOCALE = %s", quote_literal_cstr(
|
appendStringInfo(&str, " ICU_LOCALE = %s", quote_literal_cstr(
|
||||||
collInfo.icu_locale));
|
collInfo.icuLocale));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (databaseForm->datlocprovider != 0)
|
if (databaseForm->datlocprovider != 0)
|
||||||
|
@ -665,6 +680,11 @@ GenerateCreateDatabaseStatementFromPgDatabase(Form_pg_database databaseForm)
|
||||||
appendStringInfo(&str, " CONNECTION LIMIT %d", databaseForm->datconnlimit);
|
appendStringInfo(&str, " CONNECTION LIMIT %d", databaseForm->datconnlimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(collInfo.icuRules != NULL){
|
||||||
|
appendStringInfo(&str, " ICU_RULES = %s",
|
||||||
|
quote_literal_cstr(collInfo.icuRules));
|
||||||
|
}
|
||||||
|
|
||||||
appendStringInfo(&str, " IS_TEMPLATE = %s",
|
appendStringInfo(&str, " IS_TEMPLATE = %s",
|
||||||
quote_literal_cstr(databaseForm->datistemplate ? "true" : "false"));
|
quote_literal_cstr(databaseForm->datistemplate ? "true" : "false"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue