Improve index AMs' opclass validation procedures

Enterprise / PostgreSQL - Tom Lane [sss.pgh.pa.us] - 21 January 2016 18:47 UTC

The amvalidate functions added in commit 65c5fcd353a859da were on the crude side. Improve them in a few ways:

- Perform signature checking for operators and support functions.

- Apply more thorough checks for missing operators and functions, where possible.

- Instead of reporting problems as ERRORs, report most problems as INFO messages and make the amvalidate function return FALSE. This allows more than one problem to be discovered per run.

- Report object names rather than OIDs, and work a bit harder on making the messages understandable.

Also, remove a few more opr_sanity regression test queries that are now superseded by the amvalidate checks.

be44ed2 Improve index AMs' opclass validation procedures.
src/backend/access/brin/brin_validate.c | 260 ++++++++++++++++++++-------
src/backend/access/gin/ginvalidate.c | 233 ++++++++++++++++++------
src/backend/access/gist/gistvalidate.c | 241 +++++++++++++++++++------
src/backend/access/hash/hashvalidate.c | 289 +++++++++++++++++++++++-------
src/backend/access/index/Makefile | 2 +-
src/backend/access/index/amvalidate.c | 246 +++++++++++++++++++++++++
src/backend/access/nbtree/nbtvalidate.c | 274 ++++++++++++++++------------
src/backend/access/spgist/spgvalidate.c | 211 +++++++++++++++++-----
src/backend/utils/cache/lsyscache.c | 23 +++
src/include/access/amvalidate.h | 36 ++++
src/include/utils/lsyscache.h | 1 +
src/test/regress/expected/opr_sanity.out | 204 +--------------------
src/test/regress/sql/opr_sanity.sql | 171 +-----------------
13 files changed, 1417 insertions(+), 774 deletions(-)

Upstream: git.postgresql.org


  • Share