pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid including vacuum.h in tableam.h and heapam.h.
Date: Tue, 31 Mar 2026 17:44:31 +0000
Message-ID: <E1w7d8g-002LDE-2i@gemulon.postgresql.org> (raw)

Avoid including vacuum.h in tableam.h and heapam.h.

Commit 2252fcd427 modified some function prototypes in tableam.h
and heapam.h to take a VacuumParams argument instead of a pointer,
which required including vacuum.h in those headers.  vacuum.h has a
reasonably large dependency tree, and headers like tableam.h are
widely included, so this is not ideal.  To fix, change the
functions in question to accept a "const VacuumParams *" argument
instead.  That allows us to use a forward declaration for
VacuumParams and avoid including vacuum.h.  Since vacuum_rel()
needs to scribble on the params argument, we still pass it by value
to that function so that the original struct is not modified.

Reported-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/rzxpxod4c4la62yvutyrvgoyilrl2fx55djaf2suidy7np5m6c%403l2ln476eadh

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/771fe0948cad0acf883f15026c718d4f6942c8cb

Modified Files
--------------
contrib/dblink/dblink.c                    |  1 +
contrib/tablefunc/tablefunc.c              |  1 +
src/backend/access/heap/vacuumlazy.c       | 46 +++++++++++++++---------------
src/backend/catalog/toasting.c             |  1 +
src/backend/commands/analyze.c             | 26 ++++++++---------
src/backend/commands/cluster.c             |  4 +--
src/backend/commands/event_trigger.c       |  1 +
src/backend/commands/vacuum.c              | 40 +++++++++++++-------------
src/backend/postmaster/autovacuum.c        |  2 +-
src/backend/replication/logical/conflict.c |  1 +
src/backend/replication/logical/worker.c   |  1 +
src/backend/utils/adt/ri_triggers.c        |  2 ++
src/include/access/heapam.h                | 12 ++++----
src/include/access/tableam.h               |  7 +++--
src/include/commands/vacuum.h              |  6 ++--
src/pl/tcl/pltcl.c                         |  1 +
src/tools/pgindent/typedefs.list           |  1 +
17 files changed, 82 insertions(+), 71 deletions(-)



Message-ID: <E1w7d8g-002LDE-2i@gemulon.postgresql.org>
Permalink:  ../E1w7d8g-002LDE-2i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w7d8g-002LDE-2i@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid including vacuum.h in tableam.h and heapam.h.
  In-Reply-To: <E1w7d8g-002LDE-2i@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox