Re: Refactor to introduce pg_strcoll().

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Refactor to introduce pg_strcoll().
Date: 2022-10-14 23:00:10
Message-ID: 81bebda79b605cea82ce5144a8ff51f29af4611c.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2022-10-13 at 10:57 +0200, Peter Eisentraut wrote:
> 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.

Added a comment. It was a little frustrating to get a perfectly clean
API, because the callers do some buffer manipulation and optimizations
of their own. I think this is an improvement, but suggestions welcome.

If win32 is used with UTF-8 and wcscoll, it ends up allocating some
extra stack space for the temporary buffers, whereas previously it used
the buffers on the stack of varstr_cmp(). I'm not sure if that's a
problem or not.

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

Changed.

Thank you.

--
Jeff Davis
PostgreSQL Contributor Team - AWS

Attachment Content-Type Size
v2-0001-Refactor-introduce-pg_strcoll.patch text/x-patch 11.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2022-10-14 23:37:38 Re: predefined role(s) for VACUUM and ANALYZE
Previous Message Cary Huang 2022-10-14 21:56:31 Re: Avoid memory leaks during base backups