Reproducible coliisions in jsonb_hash

Поиск
Список
Период
Сортировка
От Valeriy Meleshkin
Тема Reproducible coliisions in jsonb_hash
Дата
Msg-id 36664F41-C640-428B-93EA-2282B16197FD@meleshk.in
обсуждение исходный текст
Ответы Re: Reproducible coliisions in jsonb_hash  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
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?

Cheers,
Valeriy







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

Предыдущее
От: Amul Sul
Дата:
Сообщение: Re: Make relfile tombstone files conditional on WAL level
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: First draft of the PG 15 release notes