[PATCH] Remove unused include from analyze.c
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:t252990psql -h localhost -U postgresBuilt from patchset v4 (message #4), August 23, 2026 at 07:08 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 t252990_4 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 t252990_4 && git checkout t252990_4Patchset v4 (message #4) is on t252990_4
Hi hackers,
While reading the ANALYZE code, I noticed that
src/backend/commands/analyze.c still includes storage/procarray.h,
but nothing in the file uses it anymore.
Commit 284925508ae removed the call to
GetOldestNonRemovableTransactionId() from acquire_sample_rows(), which
was the last reference to anything declared in that header. The #include
was left behind.
The attached patch removes it. The file compiles cleanly without it,
and I verified that no other symbol from procarray.h is referenced there.
Regards,
Dongpo Liu
Attachments:
v1-0001-Remove-unnecessary-include-storage-procarray.h.patchapplication/octet-stream; name=v1-0001-Remove-unnecessary-include-storage-procarray.h.patchDownload+0-2
On 7/5/26 9:27 PM, Dongpo Liu wrote:
Hi hackers,
While reading the ANALYZE code, I noticed that
src/backend/commands/analyze.c still includes storage/procarray.h,
but nothing in the file uses it anymore.Commit 284925508ae removed the call to
GetOldestNonRemovableTransactionId() from acquire_sample_rows(), which
was the last reference to anything declared in that header. The #include
was left behind.The attached patch removes it. The file compiles cleanly without it,
and I verified that no other symbol from procarray.h is referenced there.
Agree.
Furthermore, I also discovered that there are other files that contain
this unnecessary references. Please take a look at the new patch in the
attachment.
--
Quan Zongliang
On 23 Jul 2026, at 04:23, Quan Zongliang <quanzongliang@yeah.net> wrote:
On 7/5/26 9:27 PM, Dongpo Liu wrote:
The attached patch removes it. The file compiles cleanly without it,
and I verified that no other symbol from procarray.h is referenced there.Agree.
Furthermore, I also discovered that there are other files that contain this unnecessary references. Please take a look at the new patch in the attachment.
This version doesn't seem to work.
../contrib/amcheck/verify_heapam.c:773:5: error: call to undeclared function 'TransactionIdIsInProgress'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
TransactionIdIsInProgress(curr_xmin))
^
../contrib/amcheck/verify_heapam.c:2168:12: error: call to undeclared function 'TransactionIdIsInProgress'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
else if (TransactionIdIsInProgress(xid))
^
2 errors generated.
--
Daniel Gustafsson