aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/like.c
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2023-02-23 11:17:41 -0800
committerJeff Davis <jdavis@postgresql.org>2023-02-23 11:17:41 -0800
commit6974a8f7682beeb515b78b34a5253d5f96552f58 (patch)
treedd841520c02af8a0a18f96790c04a8f70bedde30 /src/backend/utils/adt/like.c
parentd87d548cd0304477413a73e9c1d148fb2d40b50d (diff)
downloadpostgresql-6974a8f7682beeb515b78b34a5253d5f96552f58.tar.gz
postgresql-6974a8f7682beeb515b78b34a5253d5f96552f58.zip
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/like.c')
-rw-r--r--src/backend/utils/adt/like.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index fc6cb7f5b75..33a2f46aab0 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -155,7 +155,7 @@ GenericMatchText(const char *s, int slen, const char *p, int plen, Oid collation
{
pg_locale_t locale = pg_newlocale_from_collation(collation);
- if (locale && !locale->deterministic)
+ if (!pg_locale_deterministic(locale))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("nondeterministic collations are not supported for LIKE")));
@@ -196,7 +196,7 @@ Generic_Text_IC_like(text *str, text *pat, Oid collation)
else
locale = pg_newlocale_from_collation(collation);
- if (locale && !locale->deterministic)
+ if (!pg_locale_deterministic(locale))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("nondeterministic collations are not supported for ILIKE")));