mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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
This commit is contained in:
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 201811012
|
#define CATALOG_VERSION_NO 201811051
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -172,8 +172,6 @@
|
|||||||
opfmethod => 'btree', opfname => 'jsonb_ops' },
|
opfmethod => 'btree', opfname => 'jsonb_ops' },
|
||||||
{ oid => '4034',
|
{ oid => '4034',
|
||||||
opfmethod => 'hash', opfname => 'jsonb_ops' },
|
opfmethod => 'hash', opfname => 'jsonb_ops' },
|
||||||
{ oid => '4035',
|
|
||||||
opfmethod => 'gist', opfname => 'jsonb_ops' },
|
|
||||||
{ oid => '4036',
|
{ oid => '4036',
|
||||||
opfmethod => 'gin', opfname => 'jsonb_ops' },
|
opfmethod => 'gin', opfname => 'jsonb_ops' },
|
||||||
{ oid => '4037',
|
{ oid => '4037',
|
||||||
|
@ -1686,6 +1686,16 @@ WHERE p1.opfmethod = 0 OR p1.opfnamespace = 0;
|
|||||||
-----
|
-----
|
||||||
(0 rows)
|
(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 ****************
|
-- **************** pg_opclass ****************
|
||||||
-- Look for illegal values in pg_opclass fields
|
-- Look for illegal values in pg_opclass fields
|
||||||
SELECT p1.oid
|
SELECT p1.oid
|
||||||
|
@ -1122,6 +1122,14 @@ SELECT p1.oid
|
|||||||
FROM pg_opfamily as p1
|
FROM pg_opfamily as p1
|
||||||
WHERE p1.opfmethod = 0 OR p1.opfnamespace = 0;
|
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 ****************
|
-- **************** pg_opclass ****************
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user