]> granicus.if.org Git - postgresql/commit
Improve index AMs' opclass validation procedures.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Jan 2016 00:47:15 +0000 (19:47 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 22 Jan 2016 00:47:15 +0000 (19:47 -0500)
commitbe44ed27b86ebd165bbedf06a4ac5a8eb943d43c
treea8371a5b5e3052dbb3b3118c24956f67c9d3b591
parentb99551832e79c915e4d877cf0a072120bd248748
Improve index AMs' opclass validation procedures.

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.
13 files changed:
src/backend/access/brin/brin_validate.c
src/backend/access/gin/ginvalidate.c
src/backend/access/gist/gistvalidate.c
src/backend/access/hash/hashvalidate.c
src/backend/access/index/Makefile
src/backend/access/index/amvalidate.c [new file with mode: 0644]
src/backend/access/nbtree/nbtvalidate.c
src/backend/access/spgist/spgvalidate.c
src/backend/utils/cache/lsyscache.c
src/include/access/amvalidate.h [new file with mode: 0644]
src/include/utils/lsyscache.h
src/test/regress/expected/opr_sanity.out
src/test/regress/sql/opr_sanity.sql