mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +03:00
Add pg_database_locale() to retrieve database default locale.
Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Discussion: https://postgr.es/m/0151ad01239e2cc7b3139644358cf8f7b9622ff7.camel@j-davis.com
This commit is contained in:
@@ -1162,6 +1162,15 @@ init_database_collation(void)
|
||||
default_locale = result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get database default locale.
|
||||
*/
|
||||
pg_locale_t
|
||||
pg_database_locale(void)
|
||||
{
|
||||
return pg_newlocale_from_collation(DEFAULT_COLLATION_OID);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a pg_locale_t from a collation OID. Results are cached for the
|
||||
* lifetime of the backend. Thus, do not free the result with freelocale().
|
||||
|
@@ -176,6 +176,7 @@ struct pg_locale_struct
|
||||
};
|
||||
|
||||
extern void init_database_collation(void);
|
||||
extern pg_locale_t pg_database_locale(void);
|
||||
extern pg_locale_t pg_newlocale_from_collation(Oid collid);
|
||||
|
||||
extern char *get_collation_actual_version(char collprovider, const char *collcollate);
|
||||
|
Reference in New Issue
Block a user