Refactor: allow pg_strncoll(), etc., to accept -1 length for NUL-terminated cstrings.

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Refactor: allow pg_strncoll(), etc., to accept -1 length for NUL-terminated cstrings.
Date: 2024-08-22 18:00:54
Message-ID: 2d758e07dff26bcc7cbe2aec57431329bfe3679a.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Like ICU, allow -1 length to mean that the input string is NUL-
terminated for pg_strncoll(), pg_strnxfrm(), and pg_strnxfrm_prefix().

This simplifies the API and code a bit.

Along with some other refactoring in this area, we are getting close to
the point where the collation provider can just be a table of methods,
which means we can add an extension hook to provide a different method
table. That still requires more work, I'm just mentioning it here for
context.

Regards,
Jeff Davis

Attachment Content-Type Size
v1-0001-Allow-length-1-for-NUL-terminated-input-to-pg_str.patch text/x-patch 12.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2024-08-22 18:28:39 Re: Index AM API cleanup
Previous Message Tom Lane 2024-08-22 17:27:31 Re: Detailed release notes