mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Add a 64-bit hash function for type citext.
Amul Sul, reviewed by Hironobu Suzuki Discussion: https://postgr.es/m/CAAJ_b947JjnNr9Cp45iNjSqKf6PA5mCTmKsRwPjows93YwQrmw@mail.gmail.com
This commit is contained in:
@ -89,6 +89,15 @@ SELECT citext_cmp('aardvark'::citext, 'aardVark'::citext) AS zero;
|
||||
SELECT citext_cmp('AARDVARK'::citext, 'AARDVARK'::citext) AS zero;
|
||||
SELECT citext_cmp('B'::citext, 'a'::citext) > 0 AS true;
|
||||
|
||||
-- Check the citext_hash() and citext_hash_extended() function explicitly.
|
||||
SELECT v as value, citext_hash(v)::bit(32) as standard,
|
||||
citext_hash_extended(v, 0)::bit(32) as extended0,
|
||||
citext_hash_extended(v, 1)::bit(32) as extended1
|
||||
FROM (VALUES (NULL::citext), ('PostgreSQL'), ('eIpUEtqmY89'), ('AXKEJBTK'),
|
||||
('muop28x03'), ('yi3nm0d73')) x(v)
|
||||
WHERE citext_hash(v)::bit(32) != citext_hash_extended(v, 0)::bit(32)
|
||||
OR citext_hash(v)::bit(32) = citext_hash_extended(v, 1)::bit(32);
|
||||
|
||||
-- Do some tests using a table and index.
|
||||
|
||||
CREATE TEMP TABLE try (
|
||||
|
Reference in New Issue
Block a user