Commit 95e28b7f authored by Tom Lane's avatar Tom Lane

Fix over-aggressive sanity check in misc_sanity.sql.

Fix thinko in commit 8be8510c: it's okay to have dbid == 0 in normal
(non-pin) entries in pg_shdepend, because global objects such as
databases are entered that way.  The test would pass so long as it
was run in a cluster containing no databases/tablespaces owned by,
or granted to, roles other than the bootstrap superuser.  That's the
expected situation for "make check", but for "make installcheck", not
so much.

Reported by Ryan Murphy.

Discussion: https://postgr.es/m/CAHeEsBc6EQe0mxGBKDXAwJbntgfvoAd5MQC-5362SmC3Tng_6g@mail.gmail.com
parent 46596f8d
...@@ -29,7 +29,7 @@ SELECT * ...@@ -29,7 +29,7 @@ SELECT *
FROM pg_shdepend as d1 FROM pg_shdepend as d1
WHERE refclassid = 0 OR refobjid = 0 OR WHERE refclassid = 0 OR refobjid = 0 OR
deptype NOT IN ('a', 'o', 'p', 'r') OR deptype NOT IN ('a', 'o', 'p', 'r') OR
(deptype != 'p' AND (dbid = 0 OR classid = 0 OR objid = 0)) OR (deptype != 'p' AND (classid = 0 OR objid = 0)) OR
(deptype = 'p' AND (dbid != 0 OR classid != 0 OR objid != 0 OR objsubid != 0)); (deptype = 'p' AND (dbid != 0 OR classid != 0 OR objid != 0 OR objsubid != 0));
dbid | classid | objid | objsubid | refclassid | refobjid | deptype dbid | classid | objid | objsubid | refclassid | refobjid | deptype
------+---------+-------+----------+------------+----------+--------- ------+---------+-------+----------+------------+----------+---------
......
...@@ -32,7 +32,7 @@ SELECT * ...@@ -32,7 +32,7 @@ SELECT *
FROM pg_shdepend as d1 FROM pg_shdepend as d1
WHERE refclassid = 0 OR refobjid = 0 OR WHERE refclassid = 0 OR refobjid = 0 OR
deptype NOT IN ('a', 'o', 'p', 'r') OR deptype NOT IN ('a', 'o', 'p', 'r') OR
(deptype != 'p' AND (dbid = 0 OR classid = 0 OR objid = 0)) OR (deptype != 'p' AND (classid = 0 OR objid = 0)) OR
(deptype = 'p' AND (dbid != 0 OR classid != 0 OR objid != 0 OR objsubid != 0)); (deptype = 'p' AND (dbid != 0 OR classid != 0 OR objid != 0 OR objsubid != 0));
......
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