Re: [HACKERS] PATCH: recursive json_populate_record()
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] PATCH: recursive json_populate_record() |
Дата | |
Msg-id | 5730.1485369204@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] PATCH: recursive json_populate_record() (Nikita Glukhov <n.gluhov@postgrespro.ru>) |
Список | pgsql-hackers |
Nikita Glukhov <n.gluhov@postgrespro.ru> writes: > On 22.01.2017 21:58, Tom Lane wrote: >> If you want such macros I think it would be better to submit a separate >> cosmetic patch that tries to hide such bit-tests behind macros throughout >> the jsonb code. > I've attached that patch, but not all the bit-tests were hidden: some of them > in jsonb_util.c still remain valid after upcoming refactoring because they > don't belong to generic code (there might be better to use JBC_XXX() macros). Pushed this; grepping found a couple other places that could be replaced by the macros, so I did. I didn't include the JsonContainerIsEmpty macro, though. It wasn't used anywhere, and I'm not exactly convinced that "IsEmpty" is more readable than "Size == 0", anyhow. We can add it later if the use-case gets stronger. > Sorry for this obvious mistake. But macros JB_ROOT_IS_XXX() also contain the > same hazard. Good point, fixed. I'll look at the rest of this in a bit. regards, tom lane
В списке pgsql-hackers по дате отправления: