pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgstattuple: Reject unlogged and temporary relations during reco
Date: Mon, 09 Nov 2026 08:05:21 +0000
Message-ID: <E1xQKNV-00000000ojF-23UB@gemulon.postgresql.org> (raw)

pgstattuple: Reject unlogged and temporary relations during recovery

Unlogged and temporary relations have no data on a standby, and trying
to query these would lead to the following failures:

ERROR:  could not open file "base/MMM/NNN": No such file or directory

These cases are now blocked with a much better error message.  Temporary
relations from other sessions were already blocked.  pg_relpages() is an
exception and can work for temp tables created by other sessions.

While on it, the error messages are clarified to depend on the relkind.
Some of the functions reported relkinds unrelated to the relation
queried.

Reported-by: Zsolt Parragi <zsolt.parragi@percona.com>
Author: Jim Jones <jim.jones@uni-muenster.de>
Author: Kirill Reshke <reshkekirill@gmail.com>
Author: Surya Poondla <suryapoondla4@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/82ba0876-6127-4770-b900-aa1bd52abfed@uni-muenster.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0091c241f6cffb2b163f18dea54c10d0b45090aa

Modified Files
--------------
contrib/pgstattuple/pgstatapprox.c | 11 ++---------
contrib/pgstattuple/pgstatindex.c  | 36 +++++++++---------------------------
contrib/pgstattuple/pgstattuple.c  | 37 +++++++++++++++++++++++++++++++------
contrib/pgstattuple/pgstattuple.h  | 21 +++++++++++++++++++++
4 files changed, 63 insertions(+), 42 deletions(-)



Message-ID: <E1xQKNV-00000000ojF-23UB@gemulon.postgresql.org>
Permalink:  ../E1xQKNV-00000000ojF-23UB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQKNV-00000000ojF-23UB@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: pgstattuple: Reject unlogged and temporary relations during reco
  In-Reply-To: <E1xQKNV-00000000ojF-23UB@gemulon.postgresql.org>
  References: <E1xQKNV-00000000ojF-23UB@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