Re: splitting pg_resetwal output strings

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: splitting pg_resetwal output strings
Date: 2026-01-31 15:08:38
Message-ID: 202601311502.ohp4cx7hfms2@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Jan-31, Álvaro Herrera wrote:

> This is not complete. It modifies PrintControlValues(), which is easy
> because I just print each item in the entries.h file in the same order
> they appear there. But for PrintNewControlValues() I'll need to add a
> symbolic identifier to each string, that the code can use to scan the
> array and print just those elements. I'll do that if there are no
> objections to this idea here.

It looks more or less like this. Patch 0001 is the same as before, and
0002 adds the symbolic names, which is used to create an enum and then
to search for the correct lines to print in PrintNewControlValues.

I decided to reuse simple_oid_list to store the integers values, which
is kinda icky, so getting to something committable I think would have me
add simple_int_list. Also, there's a few blocks that are duplicate
cases of the same line measuring and printing logic; I suppose I should
have a routine to simplify.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Most hackers will be perfectly comfortable conceptualizing users as entropy
sources, so let's move on." (Nathaniel Smith)
https://mail.gnu.org/archive/html/monotone-devel/2007-01/msg00080.html

Attachment Content-Type Size
0001-Split-out-entry-names-in-pg_resetwal.patch text/x-diff 10.7 KB
0002-Apply-the-same-technique-to-PrintNewControlValues-to.patch text/x-diff 11.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-01-31 15:54:33 Re: ABI Compliance Checker GSoC Project
Previous Message David E. Wheeler 2026-01-31 14:44:13 Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part