Commit 4165d5b6 authored by Tom Lane's avatar Tom Lane

Update oidjoins regression test to match git HEAD.

This is mostly to add some sanity checking for the pg_range catalog.
parent 4f9e3306
...@@ -769,6 +769,14 @@ WHERE provariadic != 0 AND ...@@ -769,6 +769,14 @@ WHERE provariadic != 0 AND
------+------------- ------+-------------
(0 rows) (0 rows)
SELECT ctid, protransform
FROM pg_catalog.pg_proc fk
WHERE protransform != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.protransform);
ctid | protransform
------+--------------
(0 rows)
SELECT ctid, prorettype SELECT ctid, prorettype
FROM pg_catalog.pg_proc fk FROM pg_catalog.pg_proc fk
WHERE prorettype != 0 AND WHERE prorettype != 0 AND
...@@ -777,6 +785,54 @@ WHERE prorettype != 0 AND ...@@ -777,6 +785,54 @@ WHERE prorettype != 0 AND
------+------------ ------+------------
(0 rows) (0 rows)
SELECT ctid, rngtypid
FROM pg_catalog.pg_range fk
WHERE rngtypid != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.rngtypid);
ctid | rngtypid
------+----------
(0 rows)
SELECT ctid, rngsubtype
FROM pg_catalog.pg_range fk
WHERE rngsubtype != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.rngsubtype);
ctid | rngsubtype
------+------------
(0 rows)
SELECT ctid, rngcollation
FROM pg_catalog.pg_range fk
WHERE rngcollation != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_collation pk WHERE pk.oid = fk.rngcollation);
ctid | rngcollation
------+--------------
(0 rows)
SELECT ctid, rngsubopc
FROM pg_catalog.pg_range fk
WHERE rngsubopc != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_opclass pk WHERE pk.oid = fk.rngsubopc);
ctid | rngsubopc
------+-----------
(0 rows)
SELECT ctid, rngcanonical
FROM pg_catalog.pg_range fk
WHERE rngcanonical != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.rngcanonical);
ctid | rngcanonical
------+--------------
(0 rows)
SELECT ctid, rngsubdiff
FROM pg_catalog.pg_range fk
WHERE rngsubdiff != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.rngsubdiff);
ctid | rngsubdiff
------+------------
(0 rows)
SELECT ctid, ev_class SELECT ctid, ev_class
FROM pg_catalog.pg_rewrite fk FROM pg_catalog.pg_rewrite fk
WHERE ev_class != 0 AND WHERE ev_class != 0 AND
...@@ -1153,6 +1209,14 @@ WHERE conffeqop != 0 AND ...@@ -1153,6 +1209,14 @@ WHERE conffeqop != 0 AND
------+----------- ------+-----------
(0 rows) (0 rows)
SELECT ctid, conexclop
FROM (SELECT ctid, unnest(conexclop) AS conexclop FROM pg_catalog.pg_constraint) fk
WHERE conexclop != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.conexclop);
ctid | conexclop
------+-----------
(0 rows)
SELECT ctid, proallargtypes SELECT ctid, proallargtypes
FROM (SELECT ctid, unnest(proallargtypes) AS proallargtypes FROM pg_catalog.pg_proc) fk FROM (SELECT ctid, unnest(proallargtypes) AS proallargtypes FROM pg_catalog.pg_proc) fk
WHERE proallargtypes != 0 AND WHERE proallargtypes != 0 AND
......
...@@ -385,10 +385,38 @@ SELECT ctid, provariadic ...@@ -385,10 +385,38 @@ SELECT ctid, provariadic
FROM pg_catalog.pg_proc fk FROM pg_catalog.pg_proc fk
WHERE provariadic != 0 AND WHERE provariadic != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.provariadic); NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.provariadic);
SELECT ctid, protransform
FROM pg_catalog.pg_proc fk
WHERE protransform != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.protransform);
SELECT ctid, prorettype SELECT ctid, prorettype
FROM pg_catalog.pg_proc fk FROM pg_catalog.pg_proc fk
WHERE prorettype != 0 AND WHERE prorettype != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.prorettype); NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.prorettype);
SELECT ctid, rngtypid
FROM pg_catalog.pg_range fk
WHERE rngtypid != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.rngtypid);
SELECT ctid, rngsubtype
FROM pg_catalog.pg_range fk
WHERE rngsubtype != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.rngsubtype);
SELECT ctid, rngcollation
FROM pg_catalog.pg_range fk
WHERE rngcollation != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_collation pk WHERE pk.oid = fk.rngcollation);
SELECT ctid, rngsubopc
FROM pg_catalog.pg_range fk
WHERE rngsubopc != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_opclass pk WHERE pk.oid = fk.rngsubopc);
SELECT ctid, rngcanonical
FROM pg_catalog.pg_range fk
WHERE rngcanonical != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.rngcanonical);
SELECT ctid, rngsubdiff
FROM pg_catalog.pg_range fk
WHERE rngsubdiff != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.rngsubdiff);
SELECT ctid, ev_class SELECT ctid, ev_class
FROM pg_catalog.pg_rewrite fk FROM pg_catalog.pg_rewrite fk
WHERE ev_class != 0 AND WHERE ev_class != 0 AND
...@@ -577,6 +605,10 @@ SELECT ctid, conffeqop ...@@ -577,6 +605,10 @@ SELECT ctid, conffeqop
FROM (SELECT ctid, unnest(conffeqop) AS conffeqop FROM pg_catalog.pg_constraint) fk FROM (SELECT ctid, unnest(conffeqop) AS conffeqop FROM pg_catalog.pg_constraint) fk
WHERE conffeqop != 0 AND WHERE conffeqop != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.conffeqop); NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.conffeqop);
SELECT ctid, conexclop
FROM (SELECT ctid, unnest(conexclop) AS conexclop FROM pg_catalog.pg_constraint) fk
WHERE conexclop != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_operator pk WHERE pk.oid = fk.conexclop);
SELECT ctid, proallargtypes SELECT ctid, proallargtypes
FROM (SELECT ctid, unnest(proallargtypes) AS proallargtypes FROM pg_catalog.pg_proc) fk FROM (SELECT ctid, unnest(proallargtypes) AS proallargtypes FROM pg_catalog.pg_proc) fk
WHERE proallargtypes != 0 AND WHERE proallargtypes != 0 AND
......
...@@ -5,7 +5,7 @@ findoidjoins ...@@ -5,7 +5,7 @@ findoidjoins
This program scans a database and prints oid fields (also reg* fields) This program scans a database and prints oid fields (also reg* fields)
and the tables they join to. It is normally used to check the system and the tables they join to. It is normally used to check the system
catalog join relationships (shown below for 9.1devel). catalog join relationships (shown below for 9.2devel as of 2011-11-14).
Historically this has been run against an empty database such as template1, Historically this has been run against an empty database such as template1,
but there's a problem with that approach: some of the catalogs are empty but there's a problem with that approach: some of the catalogs are empty
...@@ -16,7 +16,7 @@ catalogs in interesting ways. ...@@ -16,7 +16,7 @@ catalogs in interesting ways.
Note that unexpected matches may indicate bogus entries in system tables; Note that unexpected matches may indicate bogus entries in system tables;
don't accept a peculiar match without question. In particular, a field don't accept a peculiar match without question. In particular, a field
shown as joining to more than one target table is probably messed up. shown as joining to more than one target table is probably messed up.
In 9.1devel, the *only* fields that should join to more than one target In 9.2devel, the *only* fields that should join to more than one target
table are pg_description.objoid, pg_depend.objid, pg_depend.refobjid, table are pg_description.objoid, pg_depend.objid, pg_depend.refobjid,
pg_shdescription.objoid, pg_shdepend.objid, and pg_shdepend.refobjid. pg_shdescription.objoid, pg_shdepend.objid, and pg_shdepend.refobjid.
(Running make_oidjoins_check is an easy way to spot fields joining to more (Running make_oidjoins_check is an easy way to spot fields joining to more
...@@ -33,7 +33,7 @@ regression test. The oidjoins test should be updated after any ...@@ -33,7 +33,7 @@ regression test. The oidjoins test should be updated after any
revision in the patterns of cross-links between system tables. revision in the patterns of cross-links between system tables.
(Typically we update it at the end of each development cycle.) (Typically we update it at the end of each development cycle.)
NOTE: as of 9.1devel, make_oidjoins_check produces two bogus join checks: NOTE: as of 9.2devel, make_oidjoins_check produces two bogus join checks:
Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.oid Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.oid
Join pg_catalog.pg_database.datlastsysoid => pg_catalog.pg_database.oid Join pg_catalog.pg_database.datlastsysoid => pg_catalog.pg_database.oid
These are artifacts and should not be added to the oidjoins regress test. These are artifacts and should not be added to the oidjoins regress test.
...@@ -138,7 +138,14 @@ Join pg_catalog.pg_proc.pronamespace => pg_catalog.pg_namespace.oid ...@@ -138,7 +138,14 @@ Join pg_catalog.pg_proc.pronamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_proc.proowner => pg_catalog.pg_authid.oid Join pg_catalog.pg_proc.proowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_proc.prolang => pg_catalog.pg_language.oid Join pg_catalog.pg_proc.prolang => pg_catalog.pg_language.oid
Join pg_catalog.pg_proc.provariadic => pg_catalog.pg_type.oid Join pg_catalog.pg_proc.provariadic => pg_catalog.pg_type.oid
Join pg_catalog.pg_proc.protransform => pg_catalog.pg_proc.oid
Join pg_catalog.pg_proc.prorettype => pg_catalog.pg_type.oid Join pg_catalog.pg_proc.prorettype => pg_catalog.pg_type.oid
Join pg_catalog.pg_range.rngtypid => pg_catalog.pg_type.oid
Join pg_catalog.pg_range.rngsubtype => pg_catalog.pg_type.oid
Join pg_catalog.pg_range.rngcollation => pg_catalog.pg_collation.oid
Join pg_catalog.pg_range.rngsubopc => pg_catalog.pg_opclass.oid
Join pg_catalog.pg_range.rngcanonical => pg_catalog.pg_proc.oid
Join pg_catalog.pg_range.rngsubdiff => pg_catalog.pg_proc.oid
Join pg_catalog.pg_rewrite.ev_class => pg_catalog.pg_class.oid Join pg_catalog.pg_rewrite.ev_class => pg_catalog.pg_class.oid
Join pg_catalog.pg_shdepend.refclassid => pg_catalog.pg_class.oid Join pg_catalog.pg_shdepend.refclassid => pg_catalog.pg_class.oid
Join pg_catalog.pg_shdescription.classoid => pg_catalog.pg_class.oid Join pg_catalog.pg_shdescription.classoid => pg_catalog.pg_class.oid
...@@ -186,6 +193,7 @@ Join pg_catalog.pg_type.typcollation => pg_catalog.pg_collation.oid ...@@ -186,6 +193,7 @@ Join pg_catalog.pg_type.typcollation => pg_catalog.pg_collation.oid
Join pg_catalog.pg_constraint.conpfeqop []=> pg_catalog.pg_operator.oid Join pg_catalog.pg_constraint.conpfeqop []=> pg_catalog.pg_operator.oid
Join pg_catalog.pg_constraint.conppeqop []=> pg_catalog.pg_operator.oid Join pg_catalog.pg_constraint.conppeqop []=> pg_catalog.pg_operator.oid
Join pg_catalog.pg_constraint.conffeqop []=> pg_catalog.pg_operator.oid Join pg_catalog.pg_constraint.conffeqop []=> pg_catalog.pg_operator.oid
Join pg_catalog.pg_constraint.conexclop []=> pg_catalog.pg_operator.oid
Join pg_catalog.pg_proc.proallargtypes []=> pg_catalog.pg_type.oid Join pg_catalog.pg_proc.proallargtypes []=> pg_catalog.pg_type.oid
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment