Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4165d5b6
Commit
4165d5b6
authored
Nov 14, 2011
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update oidjoins regression test to match git HEAD.
This is mostly to add some sanity checking for the pg_range catalog.
parent
4f9e3306
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
3 deletions
+107
-3
src/test/regress/expected/oidjoins.out
src/test/regress/expected/oidjoins.out
+64
-0
src/test/regress/sql/oidjoins.sql
src/test/regress/sql/oidjoins.sql
+32
-0
src/tools/findoidjoins/README
src/tools/findoidjoins/README
+11
-3
No files found.
src/test/regress/expected/oidjoins.out
View file @
4165d5b6
...
...
@@ -769,6 +769,14 @@ WHERE provariadic != 0 AND
------+-------------
(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
FROM pg_catalog.pg_proc fk
WHERE prorettype != 0 AND
...
...
@@ -777,6 +785,54 @@ WHERE prorettype != 0 AND
------+------------
(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
FROM pg_catalog.pg_rewrite fk
WHERE ev_class != 0 AND
...
...
@@ -1153,6 +1209,14 @@ WHERE conffeqop != 0 AND
------+-----------
(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
FROM (SELECT ctid, unnest(proallargtypes) AS proallargtypes FROM pg_catalog.pg_proc) fk
WHERE proallargtypes != 0 AND
...
...
src/test/regress/sql/oidjoins.sql
View file @
4165d5b6
...
...
@@ -385,10 +385,38 @@ SELECT ctid, provariadic
FROM
pg_catalog
.
pg_proc
fk
WHERE
provariadic
!=
0
AND
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
FROM
pg_catalog
.
pg_proc
fk
WHERE
prorettype
!=
0
AND
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
FROM
pg_catalog
.
pg_rewrite
fk
WHERE
ev_class
!=
0
AND
...
...
@@ -577,6 +605,10 @@ SELECT ctid, conffeqop
FROM
(
SELECT
ctid
,
unnest
(
conffeqop
)
AS
conffeqop
FROM
pg_catalog
.
pg_constraint
)
fk
WHERE
conffeqop
!=
0
AND
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
FROM
(
SELECT
ctid
,
unnest
(
proallargtypes
)
AS
proallargtypes
FROM
pg_catalog
.
pg_proc
)
fk
WHERE
proallargtypes
!=
0
AND
...
...
src/tools/findoidjoins/README
View file @
4165d5b6
...
...
@@ -5,7 +5,7 @@ findoidjoins
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
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,
but there's a problem with that approach: some of the catalogs are empty
...
...
@@ -16,7 +16,7 @@ catalogs in interesting ways.
Note that unexpected matches may indicate bogus entries in system tables;
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.
In 9.
1
devel, the *only* fields that should join to more than one target
In 9.
2
devel, the *only* fields that should join to more than one target
table are pg_description.objoid, pg_depend.objid, pg_depend.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
...
...
@@ -33,7 +33,7 @@ regression test. The oidjoins test should be updated after any
revision in the patterns of cross-links between system tables.
(Typically we update it at the end of each development cycle.)
NOTE: as of 9.
1
devel, make_oidjoins_check produces two bogus join checks:
NOTE: as of 9.
2
devel, make_oidjoins_check produces two bogus join checks:
Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.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.
...
...
@@ -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.prolang => pg_catalog.pg_language.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_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_shdepend.refclassid => 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
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.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
---------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment