summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2018-11-05 17:02:27 +0000
committerTom Lane2018-11-05 17:02:27 +0000
commit55f3d1029676ad53621716fd15faed5848c9f4cd (patch)
treee14a3b2dbed3a82951f3223a799c39d291ad8764 /src/test
parent1eaeb02a30b307bad4d6a9cc2d596273a5a38a7a (diff)
Remove unreferenced pg_opfamily entry.
The entry with OID 4035, for GIST jsonb_ops, is unused; apparently it was added in preparation for index support that never materialized. Remove it, and add a regression test case to detect future mistakes of the same kind. Discussion: https://postgr.es/m/17188.1541379745@sss.pgh.pa.us
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/opr_sanity.out10
-rw-r--r--src/test/regress/sql/opr_sanity.sql8
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out
index 69ea821a0c..c073a5ac3f 100644
--- a/src/test/regress/expected/opr_sanity.out
+++ b/src/test/regress/expected/opr_sanity.out
@@ -1686,6 +1686,16 @@ WHERE p1.opfmethod = 0 OR p1.opfnamespace = 0;
-----
(0 rows)
+-- Look for opfamilies having no opclasses. While most validation of
+-- opfamilies is now handled by AM-specific amvalidate functions, that's
+-- driven from pg_opclass entries below, so an empty opfamily would not
+-- get noticed.
+SELECT oid, opfname FROM pg_opfamily f
+WHERE NOT EXISTS (SELECT 1 FROM pg_opclass WHERE opcfamily = f.oid);
+ oid | opfname
+-----+---------
+(0 rows)
+
-- **************** pg_opclass ****************
-- Look for illegal values in pg_opclass fields
SELECT p1.oid
diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql
index b155d90b11..91c68f4204 100644
--- a/src/test/regress/sql/opr_sanity.sql
+++ b/src/test/regress/sql/opr_sanity.sql
@@ -1122,6 +1122,14 @@ SELECT p1.oid
FROM pg_opfamily as p1
WHERE p1.opfmethod = 0 OR p1.opfnamespace = 0;
+-- Look for opfamilies having no opclasses. While most validation of
+-- opfamilies is now handled by AM-specific amvalidate functions, that's
+-- driven from pg_opclass entries below, so an empty opfamily would not
+-- get noticed.
+
+SELECT oid, opfname FROM pg_opfamily f
+WHERE NOT EXISTS (SELECT 1 FROM pg_opclass WHERE opcfamily = f.oid);
+
-- **************** pg_opclass ****************