diff options
author | Jeff Davis <jdavis@postgresql.org> | 2023-02-23 11:17:41 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2023-02-23 11:17:41 -0800 |
commit | 6974a8f7682beeb515b78b34a5253d5f96552f58 (patch) | |
tree | dd841520c02af8a0a18f96790c04a8f70bedde30 /src/backend/utils/adt/pg_locale.c | |
parent | d87d548cd0304477413a73e9c1d148fb2d40b50d (diff) |
Refactor to introduce pg_locale_deterministic().
Avoids the need of callers to test for NULL, and also avoids the need
to access the pg_locale_t structure directly.
Reviewed-by: Peter Eisentraut, Peter Geoghegan
Discussion: https://postgr.es/m/a581136455c940d7bd0ff482d3a2bd51af25a94f.camel%40j-davis.com
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index ef9efb4a7c9..274b8b9ccd7 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1481,6 +1481,15 @@ report_newlocale_failure(const char *localename) } #endif /* HAVE_LOCALE_T */ +bool +pg_locale_deterministic(pg_locale_t locale) +{ + /* default locale must always be deterministic */ + if (locale == NULL) + return true; + else + return locale->deterministic; +} /* * Create a locale_t from a collation OID. Results are cached for the |