mirror of
https://github.com/postgres/postgres.git
synced 2026-06-09 00:32:10 -04:00
Guard against uninitialized default locale.
No known problem today, but defend against issues like dbf217c1c7 in
the future.
Discussion: https://postgr.es/m/d080287d8d2d14c246c86be2e9eb611fb6b27b11.camel@j-davis.com
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Backpatch-through: 17
This commit is contained in:
parent
f52c44ce48
commit
1c77203c15
1 changed files with 6 additions and 0 deletions
|
|
@ -1192,7 +1192,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue