Re: Reproducible coliisions in jsonb_hash

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Reproducible coliisions in jsonb_hash
Дата
Msg-id bb6d4616-4edd-3f98-09ce-05a22e3fd1d6@dunslane.net
обсуждение исходный текст
Ответ на Reproducible coliisions in jsonb_hash  (Valeriy Meleshkin <valeriy@meleshk.in>)
Ответы Re: Reproducible coliisions in jsonb_hash  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2022-05-12 Th 07:02, Valeriy Meleshkin wrote:
> Hello,
>
> I've noticed that 
>
> jsonb_hash_extended(jsonb_v,0) = jsonb_hash_extended(jsonb_build_array(jsonb_v),0)
>
> for any jsonb value jsonb_v. 
>
> 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)
 
>
https://github.com/postgres/postgres/blob/27b77ecf9f4d5be211900eda54d8155ada50d696/src/backend/utils/adt/jsonb_op.c#L326
>
> Is this an intended behaviour or a bug?
>

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


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "osumi.takamichi@fujitsu.com"
Дата:
Сообщение: RE: First draft of the PG 15 release notes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: First draft of the PG 15 release notes