Re: [HACKERS] [PATCH] Generic type subscripting
От | Dmitry Dolgov |
---|---|
Тема | Re: [HACKERS] [PATCH] Generic type subscripting |
Дата | |
Msg-id | CA+q6zcUws7270pFKgT7G0jFuLxmCaBLqPL0o4sfgfLnRBGg9gg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] [PATCH] Generic type subscripting (Dmitry Dolgov <9erthalion6@gmail.com>) |
Ответы |
Re: [HACKERS] [PATCH] Generic type subscripting
|
Список | pgsql-hackers |
> On 14 November 2017 at 22:25, Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> But now I wonder if `resnull` is really needed in `jsonb_get_element`,
> `array_get_element` and it seems to me that I can even get rid of it so
On the second thought, no, looks like I'm wrong and it should be like this. The
reason is that any `fetch` function should be in form
(container, internal) -> extracted value
which means that we need to return an extracted value (for jsonb it's a `jsonb`,
for array it's an `anyelement`). But at the same time in general case we can
figure out if the result is null only inside a `fetch` function,
(`jsonb_get_element` for jsonb or whatever it may be for a custom data type)
because it returns Datum. So the only way to return this information is by
reference through the `internal` argument. To summarize, If as you said it's
not that critical, I would suggest to leave it as it is.
В списке pgsql-hackers по дате отправления: