From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Invent "amadjustmembers" AM method for validating opclass member
Date: Sat, 01 Aug 2020 21:12:59 +0000
Message-ID: <E1k1yoN-0007g3-Tu@gemulon.postgresql.org> (raw)
Invent "amadjustmembers" AM method for validating opclass members.
This allows AM-specific knowledge to be applied during creation of
pg_amop and pg_amproc entries. Specifically, the AM knows better than
core code which entries to consider as required or optional. Giving
the latter entries the appropriate sort of dependency allows them to
be dropped without taking out the whole opclass or opfamily; which
is something we'd like to have to correct obsolescent entries in
extensions.
This callback also opens the door to performing AM-specific validity
checks during opclass creation, rather than hoping than an opclass
developer will remember to test with "amvalidate". For the most part
I've not actually added any such checks yet; that can happen in a
follow-on patch. (Note that we shouldn't remove any tests from
"amvalidate", as those are still needed to cross-check manually
constructed entries in the initdb data. So adding tests to
"amadjustmembers" will be somewhat duplicative, but it seems like
a good idea anyway.)
Patch by me, reviewed by Alexander Korotkov, Hamid Akhtar, and
Anastasia Lubennikova.
Discussion: https://postgr.es/m/4578.1565195302@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9f9682783bea74bf8d93cac4f7dd65fa677f5dc7
Modified Files
--------------
contrib/bloom/blutils.c | 1 +
doc/src/sgml/indexam.sgml | 44 ++++++++-
src/backend/access/brin/brin.c | 1 +
src/backend/access/gin/ginutil.c | 1 +
src/backend/access/gin/ginvalidate.c | 65 ++++++++++++
src/backend/access/gist/gist.c | 1 +
src/backend/access/gist/gistvalidate.c | 69 +++++++++++++
src/backend/access/hash/hash.c | 1 +
src/backend/access/hash/hashvalidate.c | 96 ++++++++++++++++++
src/backend/access/index/amvalidate.c | 39 ++++++--
src/backend/access/nbtree/nbtree.c | 1 +
src/backend/access/nbtree/nbtvalidate.c | 96 ++++++++++++++++++
src/backend/access/spgist/spgutils.c | 1 +
src/backend/access/spgist/spgvalidate.c | 66 +++++++++++++
src/backend/commands/opclasscmds.c | 170 +++++++++++++++++++-------------
src/bin/pg_dump/t/002_pg_dump.pl | 10 +-
src/include/access/amapi.h | 43 ++++++++
src/include/access/amvalidate.h | 5 +-
src/include/access/gin_private.h | 4 +
src/include/access/gist_private.h | 4 +
src/include/access/hash.h | 4 +
src/include/access/nbtree.h | 4 +
src/include/access/spgist.h | 4 +
src/include/catalog/opfam_internal.h | 28 ------
24 files changed, 646 insertions(+), 112 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Invent "amadjustmembers" AM method for validating opclass member
In-Reply-To: <E1k1yoN-0007g3-Tu@gemulon.postgresql.org>
References: <E1k1yoN-0007g3-Tu@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