Re: Reproducible coliisions in jsonb_hash - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reproducible coliisions in jsonb_hash
Date
Msg-id 309877.1652363844@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reproducible coliisions in jsonb_hash  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Reproducible coliisions in jsonb_hash
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 2022-05-12 Th 07:02, Valeriy Meleshkin wrote:
>> AFAICT it happens because when iterating over a jsonb the hash function makes no distinction between raw scalars and
arrays(it doesn't inspect v.val.array.rawScalar) 

> It does look rather like a bug, but I'm unclear about the implications
> of fixing it.

Changing this hash algorithm would break existing hash indexes on jsonb
columns.  Maybe there aren't any, but even if so I can't get very excited
about changing this.  Hash algorithms always have collisions, and we have
never made any promise that ours are cryptographically strong.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: First draft of the PG 15 release notes
Next
From: Bruce Momjian
Date:
Subject: Re: First draft of the PG 15 release notes