Re: Clean up code comments for pg_wchar_tbl

From: Greg Burd <greg(at)burd(dot)me>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Clean up code comments for pg_wchar_tbl
Date: 2026-10-27 17:18:39
Message-ID: _6dewcU56fHGt0YjVRa2Yb_e7LxzzS1isVose8bQm88T-nDbZIYcY3Progu01hHN9gr4O8BH6kqBBGqT4ch8S_R04H9y7Y9nqGYbhVFMvbw=@burd.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Tuesday, October 27th, 2026 at 10:33 AM, Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:

> The documentation for the functions in the fields of pg_wchar_tbl was
> spread out all over the place and was missing a lot of detail. I
> propose the attached patch that moves the important material into the
> definition of the struct and also expands the details a bit, so that all
> the important info is in one easy to find place. Some of those details
> I gathered and inferred from various places, and some of those used to
> be more like "it works this way" where I'm now somewhat elevating it to
> "it is supposed to work this way", so maybe that's worth double-checking.
>
> I'm also removing some unnecessary typedefs for those functions, except
> where they were used elsewhere to hold local variables. This
> indirection made the code documentation harder to follow. And some of
> those typedefs had nonsensical names, like *_converter for functions
> that didn't do any converting.
>
> (I was looking for example at struct TableAmRoutine in access/tableam.h
> for inspiration for a well-commented callback table definition.)

Hello Peter,

I read over the patch, two things. First, thanks for doing these kinds of
clean-up patches. Second, looks good. I saw other things I'd change if I
were doing a cleanup beyond comments, but for a focused fix I'm +1.

nit:

s/These functions generally assume that their input is validly formed/These functions generally assume that their input is well formed and valid/

best.

-greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-10-27 17:50:50 Re: nbtree: opt-in leaf key prefix compression
Previous Message Bruce Momjian 2026-10-27 17:09:16 Re: First draft of PG 19 release notes