agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_stash_advice: Allow stashed advice to be persisted to disk.
Date: Tue, 07 Apr 2026 14:16:40 +0000
Message-ID: <E1wA7EO-003PKr-0B@gemulon.postgresql.org> (raw)

pg_stash_advice: Allow stashed advice to be persisted to disk.

If pg_stash_advice.persist = true, stashed advice will be written to
pg_stash_advice.tsv in the data directory, periodically and at
shutdown. On restart, stash modifications are locked out until this
file has been reloaded, but queries will not be, so there may be a
short window after startup during which previously-stashed advice is
not automatically applied.

Author: Robert Haas <rhaas@postgresql.org>
Co-authored-by: Lukas Fittl <lukas@fittl.com>
Discussion: https://postgr.es/m/CA+Tgmob87qsWa-VugofU6epuV0H5XjWZGMbQas4Q-ADKmvSyBg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
contrib/pg_stash_advice/Makefile                 |   4 +-
contrib/pg_stash_advice/meson.build              |   8 +-
contrib/pg_stash_advice/pg_stash_advice--1.0.sql |   6 +
contrib/pg_stash_advice/pg_stash_advice.c        | 170 ++++-
contrib/pg_stash_advice/pg_stash_advice.h        |  12 +
contrib/pg_stash_advice/stashfuncs.c             |  41 ++
contrib/pg_stash_advice/stashpersist.c           | 800 +++++++++++++++++++++++
contrib/pg_stash_advice/t/001_persist.pl         |  84 +++
doc/src/sgml/pgstashadvice.sgml                  |  70 +-
src/tools/pgindent/typedefs.list                 |   4 +
10 files changed, 1192 insertions(+), 7 deletions(-)



Message-ID: <E1wA7EO-003PKr-0B@gemulon.postgresql.org>
Permalink:  ../E1wA7EO-003PKr-0B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wA7EO-003PKr-0B@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: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_stash_advice: Allow stashed advice to be persisted to disk.
  In-Reply-To: <E1wA7EO-003PKr-0B@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox