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: Add sanity asserts for index OID and attnums during cache init
Date: Thu, 27 Jul 2023 01:56:42 +0000
Message-ID: <E1qOqF7-001WQh-57@gemulon.postgresql.org> (raw)

Add sanity asserts for index OID and attnums during cache init

There was already a check on the relation OID, but not its index OID and
the attributes that can be used during the syscache lookups.  The two
assertions added by this commit are cheap, and actually useful for
developers to fasten the detection of incorrect data in a new entry
added in the syscache list, as these assertions are triggered during the
initial cache loading (initdb, or just backend startup), not requiring a
syscache that uses the new entry.

While on it, the relation OID check is switched to use OidIsValid().

Author: Aleksander Alekseev
Reviewed-by: Dagfinn Ilmari Mannsåker, Zhang Mingli, Michael Paquier
Discussion: https://postgr.es/m/CAJ7c6TOjUTJ0jxvWY6oJeP2-840OF8ch7qscZQsuVuotXTOS_g@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/utils/cache/catcache.c | 3 +++
src/backend/utils/cache/syscache.c | 4 +++-
2 files changed, 6 insertions(+), 1 deletion(-)



Message-ID: <E1qOqF7-001WQh-57@gemulon.postgresql.org>
Permalink:  ../E1qOqF7-001WQh-57@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qOqF7-001WQh-57@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: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add sanity asserts for index OID and attnums during cache init
  In-Reply-To: <E1qOqF7-001WQh-57@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