Improve index AMs' opclass validation procedures.
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/brin/brin_validate.c | modified | +193 −67 |
| src/backend/access/gin/ginvalidate.c | modified | +178 −55 |
| src/backend/access/gist/gistvalidate.c | modified | +191 −50 |
| src/backend/access/hash/hashvalidate.c | modified | +222 −67 |
| src/backend/access/index/amvalidate.c | added | +246 −0 |
| src/backend/access/index/Makefile | modified | +1 −1 |
| src/backend/access/nbtree/nbtvalidate.c | modified | +161 −113 |
| src/backend/access/spgist/spgvalidate.c | modified | +163 −48 |
| src/backend/utils/cache/lsyscache.c | modified | +23 −0 |
| src/include/access/amvalidate.h | added | +36 −0 |
| src/include/utils/lsyscache.h | modified | +1 −0 |
| src/test/regress/expected/opr_sanity.out | modified | +1 −203 |
| src/test/regress/sql/opr_sanity.sql | modified | +1 −170 |