diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index cb1744f4d69..78243b2c795 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1199,7 +1199,13 @@ pg_newlocale_from_collation(Oid collid) bool found; if (collid == DEFAULT_COLLATION_OID) + { + /* should not happen: init_database_collation() not yet run */ + if (default_locale == NULL) + elog(ERROR, "default locale not initialized"); + return default_locale; + } /* * Some callers expect C_COLLATION_OID to succeed even without catalog