pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Thread flags through begin-scan APIs
Date: Mon, 30 Mar 2026 16:29:21 +0000
Message-ID: <E1w7FUO-002AtW-0i@gemulon.postgresql.org> (raw)

Thread flags through begin-scan APIs

Add an AM user-settable flags parameter to several of the table scan
functions, one table AM callback, and index_beginscan(). This allows
users to pass additional context to be used when building the scan
descriptors.

For index scans, a new flags field is added to IndexFetchTableData, and
the heap AM saves the caller-provided flags there.

This introduces an extension point for follow-up work to pass per-scan
information (such as whether the relation is read-only for the current
query) from the executor to the AM layer.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://postgr.es/m/2be31f17-5405-4de9-8d73-90ebc322f7d8%40vondra.me

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dcd8cc1c852cac4e65d336a79afb6b9eb9700ae1

Modified Files
--------------
contrib/pgrowlocks/pgrowlocks.c           |   2 +-
src/backend/access/brin/brin.c            |   3 +-
src/backend/access/gin/gininsert.c        |   3 +-
src/backend/access/heap/heapam_handler.c  |   9 ++-
src/backend/access/index/genam.c          |   6 +-
src/backend/access/index/indexam.c        |  13 ++--
src/backend/access/nbtree/nbtsort.c       |   3 +-
src/backend/access/table/tableam.c        |  22 ++++---
src/backend/commands/constraint.c         |   3 +-
src/backend/commands/copyto.c             |   3 +-
src/backend/commands/tablecmds.c          |  13 ++--
src/backend/commands/typecmds.c           |   6 +-
src/backend/executor/execIndexing.c       |   4 +-
src/backend/executor/execReplication.c    |  12 ++--
src/backend/executor/nodeBitmapHeapscan.c |   3 +-
src/backend/executor/nodeIndexonlyscan.c  |   9 ++-
src/backend/executor/nodeIndexscan.c      |  12 ++--
src/backend/executor/nodeSamplescan.c     |   3 +-
src/backend/executor/nodeSeqscan.c        |   9 ++-
src/backend/executor/nodeTidrangescan.c   |   7 +-
src/backend/partitioning/partbounds.c     |   3 +-
src/backend/utils/adt/selfuncs.c          |   3 +-
src/include/access/genam.h                |   6 +-
src/include/access/heapam.h               |   5 +-
src/include/access/relscan.h              |   6 ++
src/include/access/tableam.h              | 103 ++++++++++++++++++++++--------
26 files changed, 185 insertions(+), 86 deletions(-)



Message-ID: <E1w7FUO-002AtW-0i@gemulon.postgresql.org>
Permalink:  ../E1w7FUO-002AtW-0i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w7FUO-002AtW-0i@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: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Thread flags through begin-scan APIs
  In-Reply-To: <E1w7FUO-002AtW-0i@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