diff options
Diffstat (limited to 'src/test/regress/expected/opr_sanity.out')
| -rw-r--r-- | src/test/regress/expected/opr_sanity.out | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index a0ffd77e0e..8e4004ed31 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -1053,7 +1053,22 @@ ORDER BY 1, 2, 3; 2742 | 2 | @@@ 2742 | 3 | <@ 2742 | 4 | = -(43 rows) + 4000 | 1 | << + 4000 | 1 | ~<~ + 4000 | 2 | ~<=~ + 4000 | 3 | = + 4000 | 4 | ~>=~ + 4000 | 5 | >> + 4000 | 5 | ~>~ + 4000 | 6 | ~= + 4000 | 8 | <@ + 4000 | 10 | <^ + 4000 | 11 | < + 4000 | 11 | >^ + 4000 | 12 | <= + 4000 | 14 | >= + 4000 | 15 | > +(58 rows) -- Check that all opclass search operators have selectivity estimators. -- This is not absolutely required, but it seems a reasonable thing @@ -1077,6 +1092,24 @@ WHERE NOT EXISTS(SELECT 1 FROM pg_amop AS p2 ---------+----------- (0 rows) +-- Check that each operator listed in pg_amop has an associated opclass, +-- that is one whose opcintype matches oprleft (possibly by coercion). +-- Otherwise the operator is useless because it cannot be matched to an index. +-- (In principle it could be useful to list such operators in multiple-datatype +-- btree opfamilies, but in practice you'd expect there to be an opclass for +-- every datatype the family knows about.) +SELECT p1.amopfamily, p1.amopstrategy, p1.amopopr +FROM pg_amop AS p1 +WHERE NOT EXISTS(SELECT 1 FROM pg_opclass AS p2 + WHERE p2.opcfamily = p1.amopfamily + AND binary_coercible(p2.opcintype, p1.amoplefttype)); + amopfamily | amopstrategy | amopopr +------------+--------------+--------- + 1029 | 27 | 433 + 1029 | 47 | 757 + 1029 | 67 | 759 +(3 rows) + -- Operators that are primary members of opclasses must be immutable (else -- it suggests that the index ordering isn't fixed). Operators that are -- cross-type members need only be stable, since they are just shorthands @@ -1297,6 +1330,27 @@ ORDER BY 1; 2226 | 1 | hashint4 | cid_ops (6 rows) +-- We can also check SP-GiST carefully, since the support routine signatures +-- are independent of the datatype being indexed. +SELECT p1.amprocfamily, p1.amprocnum, + p2.oid, p2.proname, + p3.opfname +FROM pg_amproc AS p1, pg_proc AS p2, pg_opfamily AS p3 +WHERE p3.opfmethod = (SELECT oid FROM pg_am WHERE amname = 'spgist') + AND p1.amprocfamily = p3.oid AND p1.amproc = p2.oid AND + (CASE WHEN amprocnum = 1 OR amprocnum = 2 OR amprocnum = 3 OR amprocnum = 4 + THEN prorettype != 'void'::regtype OR proretset OR pronargs != 2 + OR proargtypes[0] != 'internal'::regtype + OR proargtypes[1] != 'internal'::regtype + WHEN amprocnum = 5 + THEN prorettype != 'bool'::regtype OR proretset OR pronargs != 2 + OR proargtypes[0] != 'internal'::regtype + OR proargtypes[1] != 'internal'::regtype + ELSE true END); + amprocfamily | amprocnum | oid | proname | opfname +--------------+-----------+-----+---------+--------- +(0 rows) + -- Support routines that are primary members of opfamilies must be immutable -- (else it suggests that the index ordering isn't fixed). But cross-type -- members need only be stable, since they are just shorthands |
