pgsql: pg_stash_advice: Allow stashed advice to be persisted to disk.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_stash_advice: Allow stashed advice to be persisted to disk.
Date: 2026-04-07 14:16:40
Message-ID: E1wA7EO-003PKr-0B@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)postgresql(dot)org>
Co-authored-by: Lukas Fittl <lukas(at)fittl(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2026-04-07 14:35:18 pgsql: Add errdetail() with PID and UID about source of termination sig
Previous Message Andres Freund 2026-04-07 13:52:02 pgsql: Minimal fix for WAIT FOR ... MODE 'standby_flush'