Fix casting away const in _bt_reorder_array_cmp
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t52999psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 27, 2026 at 05:21 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t52999_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t52999_1 && git checkout t52999_1Patchset v1 (message #1) is on t52999_1
Hi Hackers,
There have been several recent efforts to eliminate cast-away-const usages.
While reviewing another patch, I happened to notice one such occurrence, so
I’m posting a trivial patch to fix it.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
Hi,
On Wed, Dec 31, 2025 at 03:51:55PM +0800, Chao Li wrote:
Hi Hackers,
There have been several recent efforts to eliminate cast-away-const usages.
While reviewing another patch, I happened to notice one such occurrence, so
I’m posting a trivial patch to fix it.
Thanks for the patch!
This one is one that I choose to discard in [1]/messages/by-id/aUQHy/MmWq7c97wK@ip-10-97-1-34.eu-west-3.compute.internal because this is just a thin
wrapper. Not saying that keeping cast away const was a good thing but the idea
was also to reduce the number of changes in the patch.
The criteria was:
"
Indeed, I did some filtering and decided not to change the ones
that:
- are just thin wrappers
- would require public API changes
- rely on external functions (such as LZ4F_compressUpdate())
- would require changes beyond the scope of this cleanup"
That said, also removing explicit casts when assigning from void pointers
(relying on implicit conversion instead) is also valuable and your patch does
exactly this.
That could be part of a larger project though (as mentioned in [2]/messages/by-id/aVTiCHBalaFCneYD@ip-10-97-1-34.eu-west-3.compute.internal).
Thoughts?
[1]: /messages/by-id/aUQHy/MmWq7c97wK@ip-10-97-1-34.eu-west-3.compute.internal
[2]: /messages/by-id/aVTiCHBalaFCneYD@ip-10-97-1-34.eu-west-3.compute.internal
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
On 31.12.25 10:01, Bertrand Drouvot wrote:
On Wed, Dec 31, 2025 at 03:51:55PM +0800, Chao Li wrote:
There have been several recent efforts to eliminate cast-away-const usages.
While reviewing another patch, I happened to notice one such occurrence, so
I’m posting a trivial patch to fix it.Thanks for the patch!
This one is one that I choose to discard in [1] because this is just a thin
wrapper. Not saying that keeping cast away const was a good thing but the idea
was also to reduce the number of changes in the patch.
I have committed this one together with Bertrand's other changes.