From 68c3549fb56834f47d57ef010ffbd3bdbd80b941 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 25 Jul 2015 15:46:26 -0400 Subject: [PATCH] Update oidjoins regression test for 9.5. New FK relationships for pg_transform. Also findoidjoins now detects a few relationships it didn't before for pre-existing catalogs, as a result of new regression tests leaving entries in those catalogs that weren't there before. --- src/test/regress/expected/oidjoins.out | 72 ++++++++++++++++++++++++++ src/test/regress/sql/oidjoins.sql | 36 +++++++++++++ 2 files changed, 108 insertions(+) diff --git a/src/test/regress/expected/oidjoins.out b/src/test/regress/expected/oidjoins.out index bee76ce8f2..d85bc83e11 100644 --- a/src/test/regress/expected/oidjoins.out +++ b/src/test/regress/expected/oidjoins.out @@ -545,6 +545,30 @@ WHERE extnamespace != 0 AND ------+-------------- (0 rows) +SELECT ctid, fdwowner +FROM pg_catalog.pg_foreign_data_wrapper fk +WHERE fdwowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.fdwowner); + ctid | fdwowner +------+---------- +(0 rows) + +SELECT ctid, srvowner +FROM pg_catalog.pg_foreign_server fk +WHERE srvowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.srvowner); + ctid | srvowner +------+---------- +(0 rows) + +SELECT ctid, srvfdw +FROM pg_catalog.pg_foreign_server fk +WHERE srvfdw != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_foreign_data_wrapper pk WHERE pk.oid = fk.srvfdw); + ctid | srvfdw +------+-------- +(0 rows) + SELECT ctid, indexrelid FROM pg_catalog.pg_index fk WHERE indexrelid != 0 AND @@ -609,6 +633,22 @@ WHERE lanvalidator != 0 AND ------+-------------- (0 rows) +SELECT ctid, loid +FROM pg_catalog.pg_largeobject fk +WHERE loid != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_largeobject_metadata pk WHERE pk.oid = fk.loid); + ctid | loid +------+------ +(0 rows) + +SELECT ctid, lomowner +FROM pg_catalog.pg_largeobject_metadata fk +WHERE lomowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.lomowner); + ctid | lomowner +------+---------- +(0 rows) + SELECT ctid, nspowner FROM pg_catalog.pg_namespace fk WHERE nspowner != 0 AND @@ -945,6 +985,38 @@ WHERE spcowner != 0 AND ------+---------- (0 rows) +SELECT ctid, trftype +FROM pg_catalog.pg_transform fk +WHERE trftype != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.trftype); + ctid | trftype +------+--------- +(0 rows) + +SELECT ctid, trflang +FROM pg_catalog.pg_transform fk +WHERE trflang != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_language pk WHERE pk.oid = fk.trflang); + ctid | trflang +------+--------- +(0 rows) + +SELECT ctid, trffromsql +FROM pg_catalog.pg_transform fk +WHERE trffromsql != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.trffromsql); + ctid | trffromsql +------+------------ +(0 rows) + +SELECT ctid, trftosql +FROM pg_catalog.pg_transform fk +WHERE trftosql != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.trftosql); + ctid | trftosql +------+---------- +(0 rows) + SELECT ctid, tgrelid FROM pg_catalog.pg_trigger fk WHERE tgrelid != 0 AND diff --git a/src/test/regress/sql/oidjoins.sql b/src/test/regress/sql/oidjoins.sql index 651068b964..2fa628d0f7 100644 --- a/src/test/regress/sql/oidjoins.sql +++ b/src/test/regress/sql/oidjoins.sql @@ -273,6 +273,18 @@ SELECT ctid, extnamespace FROM pg_catalog.pg_extension fk WHERE extnamespace != 0 AND NOT EXISTS(SELECT 1 FROM pg_catalog.pg_namespace pk WHERE pk.oid = fk.extnamespace); +SELECT ctid, fdwowner +FROM pg_catalog.pg_foreign_data_wrapper fk +WHERE fdwowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.fdwowner); +SELECT ctid, srvowner +FROM pg_catalog.pg_foreign_server fk +WHERE srvowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.srvowner); +SELECT ctid, srvfdw +FROM pg_catalog.pg_foreign_server fk +WHERE srvfdw != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_foreign_data_wrapper pk WHERE pk.oid = fk.srvfdw); SELECT ctid, indexrelid FROM pg_catalog.pg_index fk WHERE indexrelid != 0 AND @@ -305,6 +317,14 @@ SELECT ctid, lanvalidator FROM pg_catalog.pg_language fk WHERE lanvalidator != 0 AND NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.lanvalidator); +SELECT ctid, loid +FROM pg_catalog.pg_largeobject fk +WHERE loid != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_largeobject_metadata pk WHERE pk.oid = fk.loid); +SELECT ctid, lomowner +FROM pg_catalog.pg_largeobject_metadata fk +WHERE lomowner != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.lomowner); SELECT ctid, nspowner FROM pg_catalog.pg_namespace fk WHERE nspowner != 0 AND @@ -473,6 +493,22 @@ SELECT ctid, spcowner FROM pg_catalog.pg_tablespace fk WHERE spcowner != 0 AND NOT EXISTS(SELECT 1 FROM pg_catalog.pg_authid pk WHERE pk.oid = fk.spcowner); +SELECT ctid, trftype +FROM pg_catalog.pg_transform fk +WHERE trftype != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.trftype); +SELECT ctid, trflang +FROM pg_catalog.pg_transform fk +WHERE trflang != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_language pk WHERE pk.oid = fk.trflang); +SELECT ctid, trffromsql +FROM pg_catalog.pg_transform fk +WHERE trffromsql != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.trffromsql); +SELECT ctid, trftosql +FROM pg_catalog.pg_transform fk +WHERE trftosql != 0 AND + NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.trftosql); SELECT ctid, tgrelid FROM pg_catalog.pg_trigger fk WHERE tgrelid != 0 AND -- 2.40.0