Cleanup: Duplicated, misplaced comment in HeapScanDescData
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:t46976psql -h localhost -U postgresBuilt from patchset v2 (message #2), July 28, 2026 at 01:40 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 t46976_2 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 t46976_2 && git checkout t46976_2Patchset v2 (message #2) is on t46976_2
Hi,
I noticed that the comment on/beneath rs_numblocks in HeapScanDescData
is duplicated above rs_strategy. I don't know if there should have
been a different comment above rs_strategy, but the current one is
definitely out of place, so I propose to remove it as per attached.
The comment was duplicated in c2fe139c20 with the update to the table
scan APIs, which was first seen in PostgreSQL 11.
Kind regards,
Matthias van de Meent
Attachments:
v1-0001-Remove-duplicate-of-comment-under-rs_numblocks.patchapplication/octet-stream; name=v1-0001-Remove-duplicate-of-comment-under-rs_numblocks.patchDownload+0-2
On Mon, 21 Nov 2022 at 12:12, Matthias van de Meent
<boekewurm+postgres@gmail.com> wrote:
Hi,
I noticed that the comment on/beneath rs_numblocks in HeapScanDescData
is duplicated above rs_strategy. I don't know if there should have
been a different comment above rs_strategy, but the current one is
definitely out of place, so I propose to remove it as per attached.The comment was duplicated in c2fe139c20 with the update to the table
scan APIs, which was first seen in PostgreSQL 11.
I made a mistake in determining this version number; it was PostgreSQL
12 where this commit was first included. Attached is the same patch
with the description updated accordingly.
Kind regards,
Matthias van de Meent
Hi,
On 2022-11-21 12:34:12 +0100, Matthias van de Meent wrote:
On Mon, 21 Nov 2022 at 12:12, Matthias van de Meent
<boekewurm+postgres@gmail.com> wrote:Hi,
I noticed that the comment on/beneath rs_numblocks in HeapScanDescData
is duplicated above rs_strategy. I don't know if there should have
been a different comment above rs_strategy, but the current one is
definitely out of place, so I propose to remove it as per attached.The comment was duplicated in c2fe139c20 with the update to the table
scan APIs, which was first seen in PostgreSQL 11.I made a mistake in determining this version number; it was PostgreSQL
12 where this commit was first included. Attached is the same patch
with the description updated accordingly.
I guess that happened because of the odd placement of the comment from
before the change:
bool rs_temp_snap; /* unregister snapshot at scan end? */
-
- /* state set up at initscan time */
- BlockNumber rs_nblocks; /* total number of blocks in rel */
- BlockNumber rs_startblock; /* block # to start at */
- BlockNumber rs_numblocks; /* max number of blocks to scan */
- /* rs_numblocks is usually InvalidBlockNumber, meaning "scan whole rel" */
- BufferAccessStrategy rs_strategy; /* access strategy for reads */
bool rs_syncscan; /* report location to syncscan logic? */
We rarely put comments document a struct member after it.
I'm inclined to additionally move the "legitimate" copy of the comment
to before rs_numblocks, rather than after it.
Greetings,
Andres Freund