Re: Refactor to introduce pg_strcoll().

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Refactor to introduce pg_strcoll().
Date: 2022-10-13 08:57:38
Message-ID: 0a65336c-a3e6-20a5-55fe-b7b50dd73fa4@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07.10.22 01:15, Jeff Davis wrote:
> + * Call ucol_strcollUTF8(), ucol_strcoll(), strcoll(), strcoll_l(), wcscoll(),
> + * or wcscoll_l() as appropriate for the given locale, platform, and database
> + * encoding. Arguments must be NUL-terminated. If the locale is not specified,
> + * use the database collation.
> + *
> + * If the collation is deterministic, break ties with memcmp(), and then with
> + * the string length.
> + */
> +int
> +pg_strcoll(const char *arg1, int len1, const char *arg2, int len2,
> + pg_locale_t locale)

It's a bit confusing that arguments must be NUL-terminated, but the
length is still specified. Maybe another sentence to explain that would
be helpful.

The length arguments ought to be of type size_t, I think.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shiy.fnst@fujitsu.com 2022-10-13 09:24:51 RE: [RFC] building postgres with meson - v13
Previous Message Dmitry Koval 2022-10-13 08:57:33 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands