mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
Give inet/cidr datatypes their own hash function that ignores the inet vs
cidr type bit, the same as network_eq does. This is needed for hash joins and hash aggregation to work correctly on these types. Per bug report from Michael Fuhr, 2004-04-13. Also, improve hash function for int8 as suggested by Greg Stark.
This commit is contained in:
@@ -487,6 +487,16 @@ WHERE p1.oprcanhash AND NOT EXISTS
|
||||
-----+---------
|
||||
(0 rows)
|
||||
|
||||
-- And the converse.
|
||||
SELECT p1.oid, p1.oprname, op.opcname
|
||||
FROM pg_operator AS p1, pg_opclass op, pg_amop p
|
||||
WHERE amopopr = p1.oid AND amopclaid = op.oid
|
||||
AND opcamid = (SELECT oid FROM pg_am WHERE amname = 'hash')
|
||||
AND NOT p1.oprcanhash;
|
||||
oid | oprname | opcname
|
||||
-----+---------+---------
|
||||
(0 rows)
|
||||
|
||||
-- Check that each operator defined in pg_operator matches its oprcode entry
|
||||
-- in pg_proc. Easiest to do this separately for each oprkind.
|
||||
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
|
||||
|
||||
@@ -409,6 +409,13 @@ WHERE p1.oprcanhash AND NOT EXISTS
|
||||
WHERE opcamid = (SELECT oid FROM pg_am WHERE amname = 'hash') AND
|
||||
amopopr = p1.oid);
|
||||
|
||||
-- And the converse.
|
||||
|
||||
SELECT p1.oid, p1.oprname, op.opcname
|
||||
FROM pg_operator AS p1, pg_opclass op, pg_amop p
|
||||
WHERE amopopr = p1.oid AND amopclaid = op.oid
|
||||
AND opcamid = (SELECT oid FROM pg_am WHERE amname = 'hash')
|
||||
AND NOT p1.oprcanhash;
|
||||
|
||||
-- Check that each operator defined in pg_operator matches its oprcode entry
|
||||
-- in pg_proc. Easiest to do this separately for each oprkind.
|
||||
|
||||
Reference in New Issue
Block a user