Skip to content

Conversation

@yaroslavsavateykin
Copy link

Применил функцию jsonb_valid()

WHEN additional_data = '' THEN jsonb_build_array('{}'::jsonb)
CASE
WHEN additional_data IS NULL OR additional_data = '' THEN jsonb_build_array('{}'::jsonb)
--WHEN NOT jsonb_valid(additional_data) THEN jsonb_build_array('{}'::jsonb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

убери комментарий

WHEN additional_data ~ '^\{.*\}$' THEN additional_data::jsonb
WHEN jsonb_typeof(additional_data::jsonb) = 'array' THEN additional_data::jsonb
ELSE jsonb_build_array(additional_data::jsonb)
ELSE jsonb_build_array(additional_data::jsonb)
Copy link
Contributor

@VladislavVoskoboinik VladislavVoskoboinik Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а чем 31 и 32 строчки отличаются по смыслу?
сейчас написано: если массив, то преобразуем в json

иначе преобразуем в массив джейсонов

точно ли это имел в виду?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants