@@ -5,7 +5,7 @@ findoidjoins
5
5
6
6
This program scans a database and prints oid fields (also reg* fields)
7
7
and the tables they join to. It is normally used to check the system
8
- catalog join relationships (shown below for 9.6devel as of 2016-01-16 ).
8
+ catalog join relationships (shown below for 10devel as of 2017-05-15 ).
9
9
10
10
Historically this has been run against an empty database such as template1,
11
11
but there's a problem with that approach: some of the catalogs are empty
@@ -16,7 +16,7 @@ catalogs in interesting ways.
16
16
Note that unexpected matches may indicate bogus entries in system tables;
17
17
don't accept a peculiar match without question. In particular, a field
18
18
shown as joining to more than one target table is probably messed up.
19
- In 9.6 , the *only* fields that should join to more than one target
19
+ In v10 , the *only* fields that should join to more than one target
20
20
table are:
21
21
pg_description.objoid, pg_depend.objid, pg_depend.refobjid,
22
22
pg_shdescription.objoid, pg_shdepend.objid, pg_shdepend.refobjid,
@@ -35,13 +35,29 @@ regression test. The oidjoins test should be updated after any
35
35
revision in the patterns of cross-links between system tables.
36
36
(Typically we update it at the end of each development cycle.)
37
37
38
- NOTE: as of 9.6 , make_oidjoins_check produces two bogus join checks:
38
+ NOTE: as of v10 , make_oidjoins_check produces two bogus join checks:
39
39
Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.oid
40
40
Join pg_catalog.pg_database.datlastsysoid => pg_catalog.pg_database.oid
41
41
These are artifacts and should not be added to the oidjoins regression test.
42
42
You might also get output for pg_shdepend.refobjid and pg_shdescription.objoid,
43
43
neither of which should be added to the regression test.
44
44
45
+ In short, the procedure is:
46
+
47
+ 1. make installcheck in src/test/regress
48
+ 2. cd here, make
49
+ 3. ./findoidjoins regression >foj.out
50
+ 4. ./make_oidjoins_check foj.out >oidjoins.sql
51
+ 5. paste foj.out below, removing the entries reported as duplicative
52
+ by make_oidjoins_check or described as bogus above
53
+ 6. remove bogus tests in oidjoins.sql as per above
54
+ 7. copy oidjoins.sql to src/test/regress/sql/,
55
+ and update oidjoins.out to match.
56
+ 8. Review diffs to ensure they correspond to new catalog relationships,
57
+ then commit. (Sometimes, a pre-existing catalog relationship might
58
+ become newly visible here as a result of the regression tests populating
59
+ a catalog they didn't before. That's OK too.)
60
+
45
61
---------------------------------------------------------------------------
46
62
47
63
Join pg_catalog.pg_aggregate.aggfnoid => pg_catalog.pg_proc.oid
@@ -71,6 +87,9 @@ Join pg_catalog.pg_attrdef.adrelid => pg_catalog.pg_class.oid
71
87
Join pg_catalog.pg_attribute.attrelid => pg_catalog.pg_class.oid
72
88
Join pg_catalog.pg_attribute.atttypid => pg_catalog.pg_type.oid
73
89
Join pg_catalog.pg_attribute.attcollation => pg_catalog.pg_collation.oid
90
+ Join pg_catalog.pg_auth_members.roleid => pg_catalog.pg_authid.oid
91
+ Join pg_catalog.pg_auth_members.member => pg_catalog.pg_authid.oid
92
+ Join pg_catalog.pg_auth_members.grantor => pg_catalog.pg_authid.oid
74
93
Join pg_catalog.pg_cast.castsource => pg_catalog.pg_type.oid
75
94
Join pg_catalog.pg_cast.casttarget => pg_catalog.pg_type.oid
76
95
Join pg_catalog.pg_cast.castfunc => pg_catalog.pg_proc.oid
@@ -134,6 +153,7 @@ Join pg_catalog.pg_operator.oprjoin => pg_catalog.pg_proc.oid
134
153
Join pg_catalog.pg_opfamily.opfmethod => pg_catalog.pg_am.oid
135
154
Join pg_catalog.pg_opfamily.opfnamespace => pg_catalog.pg_namespace.oid
136
155
Join pg_catalog.pg_opfamily.opfowner => pg_catalog.pg_authid.oid
156
+ Join pg_catalog.pg_partitioned_table.partrelid => pg_catalog.pg_class.oid
137
157
Join pg_catalog.pg_policy.polrelid => pg_catalog.pg_class.oid
138
158
Join pg_catalog.pg_proc.pronamespace => pg_catalog.pg_namespace.oid
139
159
Join pg_catalog.pg_proc.proowner => pg_catalog.pg_authid.oid
@@ -148,6 +168,8 @@ Join pg_catalog.pg_range.rngsubopc => pg_catalog.pg_opclass.oid
148
168
Join pg_catalog.pg_range.rngcanonical => pg_catalog.pg_proc.oid
149
169
Join pg_catalog.pg_range.rngsubdiff => pg_catalog.pg_proc.oid
150
170
Join pg_catalog.pg_rewrite.ev_class => pg_catalog.pg_class.oid
171
+ Join pg_catalog.pg_sequence.seqrelid => pg_catalog.pg_class.oid
172
+ Join pg_catalog.pg_sequence.seqtypid => pg_catalog.pg_type.oid
151
173
Join pg_catalog.pg_shdepend.refclassid => pg_catalog.pg_class.oid
152
174
Join pg_catalog.pg_shdescription.classoid => pg_catalog.pg_class.oid
153
175
Join pg_catalog.pg_statistic.starelid => pg_catalog.pg_class.oid
@@ -156,6 +178,9 @@ Join pg_catalog.pg_statistic.staop2 => pg_catalog.pg_operator.oid
156
178
Join pg_catalog.pg_statistic.staop3 => pg_catalog.pg_operator.oid
157
179
Join pg_catalog.pg_statistic.staop4 => pg_catalog.pg_operator.oid
158
180
Join pg_catalog.pg_statistic.staop5 => pg_catalog.pg_operator.oid
181
+ Join pg_catalog.pg_statistic_ext.stxrelid => pg_catalog.pg_class.oid
182
+ Join pg_catalog.pg_statistic_ext.stxnamespace => pg_catalog.pg_namespace.oid
183
+ Join pg_catalog.pg_statistic_ext.stxowner => pg_catalog.pg_authid.oid
159
184
Join pg_catalog.pg_tablespace.spcowner => pg_catalog.pg_authid.oid
160
185
Join pg_catalog.pg_transform.trftype => pg_catalog.pg_type.oid
161
186
Join pg_catalog.pg_transform.trflang => pg_catalog.pg_language.oid
0 commit comments