@ -980,10 +980,9 @@ WHERE p3.opfmethod = (SELECT oid FROM pg_am WHERE amname = 'btree')
-- For hash we can also do a little better: the support routines must be
-- For hash we can also do a little better: the support routines must be
-- of the form hash(lefttype) returns int4. There are several cases where
-- of the form hash(lefttype) returns int4. There are several cases where
-- we cheat and use a hash function that is physically compatible with the
-- we cheat and use a hash function that is physically compatible with the
-- datatype even though there's no cast, so for now we can't check that.
-- datatype even though there's no cast, so this check does find a small
SELECT p1.amprocfamily, p1.amprocnum,
-- number of entries.
p2.oid, p2.proname,
SELECT p1.amprocfamily, p1.amprocnum, p2.proname, p3.opfname
p3.opfname
FROM pg_amproc AS p1, pg_proc AS p2, pg_opfamily AS p3
FROM pg_amproc AS p1, pg_proc AS p2, pg_opfamily AS p3
WHERE p3.opfmethod = (SELECT oid FROM pg_am WHERE amname = 'hash')
WHERE p3.opfmethod = (SELECT oid FROM pg_am WHERE amname = 'hash')
AND p1.amprocfamily = p3.oid AND p1.amproc = p2.oid AND
AND p1.amprocfamily = p3.oid AND p1.amproc = p2.oid AND
@ -991,11 +990,20 @@ WHERE p3.opfmethod = (SELECT oid FROM pg_am WHERE amname = 'hash')
OR proretset
OR proretset
OR prorettype != 'int4'::regtype
OR prorettype != 'int4'::regtype
OR pronargs != 1
OR pronargs != 1
-- OR NOT physically_coercible(amproclefttype, proargtypes[0])
OR NOT physically_coercible(amproclefttype, proargtypes[0])
OR amproclefttype != amprocrighttype);
OR amproclefttype != amprocrighttype)
amprocfamily | amprocnum | oid | proname | opfname
ORDER BY 1;
--------------+-----------+-----+---------+---------
amprocfamily | amprocnum | proname | opfname
(0 rows)
--------------+-----------+----------------+--------------------
435 | 1 | hashint4 | date_ops
1999 | 1 | timestamp_hash | timestamptz_ops
2222 | 1 | hashchar | bool_ops
2223 | 1 | hashvarlena | bytea_ops
2225 | 1 | hashint4 | xid_ops
2226 | 1 | hashint4 | cid_ops
2229 | 1 | hashvarlena | text_pattern_ops
2231 | 1 | hashvarlena | bpchar_pattern_ops
(8 rows)
-- Support routines that are primary members of opfamilies must be immutable
-- Support routines that are primary members of opfamilies must be immutable
-- (else it suggests that the index ordering isn't fixed). But cross-type
-- (else it suggests that the index ordering isn't fixed). But cross-type