Re: Refactor to eliminate cast-away-const in pg_dump object sort comparator

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Subject: Re: Refactor to eliminate cast-away-const in pg_dump object sort comparator
Date: 2025-12-29 09:44:22
Message-ID: CAEoWx2=4ieNiGp0c_SLkf-FZnc1KWyrn1W1Naaprpi1L6OfUog@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Dec 24, 2025, at 09:58, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:

Hi Hacker,

While reviewing patch [1], I raised a comment about cast-away-const in
pg_dump_sort.c. However, the comment was not accepted and the argument was
that the nearby code did the same thing.

I saw Tom recently had a commit [2] that removed some cast-away-const in
ecpg, so I am filing this patch to eliminate all cast-away-const problems
in pg_dump_sort.c.

[1]
https://postgr.es/m/CALDaNm2x3rd7C0_HjUpJFbxpAqXgm=QtoKfkEWDVA8h+JFpa_w@mail.gmail.com
[2]
https://git.postgresql.org/cgit/postgresql.git/commit/?id=4eda42e8bdf5bd3bf69576d54a45c10e7cbc3b35

I just noticed this patch does the similar thing as [3] just handling a
different file. As Peter had a comment on [3], I addressed the comment as
well in v2.

[3]
https://postgr.es/m/aUQHy/MmWq7c97wK(at)ip-10-97-1-34(dot)eu-west-3(dot)compute(dot)internal

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachment Content-Type Size
v2-0001-Refactor-to-eliminate-cast-away-const-in-pg_dump-.patch application/octet-stream 6.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Soumya S Murali 2025-12-29 10:07:40 Re: Checkpointer write combining
Previous Message Chao Li 2025-12-29 09:28:06 Re: Don't cast away const where possible