Re: BUG #13768: JSONB concat

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: BUG #13768: JSONB concat
Дата
Msg-id
30495.1447258715@sss.pgh.pa.us
Ответ на
BUG #13768: JSONB concat (awasarax@yandex.ru)
Список
Дерево обсуждения
BUG #13768: JSONB concat awasarax@yandex.ru
Re: BUG #13768: JSONB concat Tom Lane <tgl@sss.pgh.pa.us>
awasarax@yandex.ru writes:
> if "d" is null then return = null
> else
> return <> null

> CREATE OR REPLACE FUNCTION userfunc(jsonb)
>   RETURNS jsonb AS
> $BODY$
> DECLARE
>  r jsonb = null;
>  d jsonb = null;
> BEGIN
>  SELECT to_json(users.*) INTO r FROM users WHERE ///////; 
>  RETURN r||d; -- return null
> END;
> $BODY$
>   LANGUAGE plpgsql VOLATILE; 


I see nothing particularly wrong here.  There is long-established
precedent, eg, 'foo'::text || NULL is null too.  It makes sense
if you consider that NULL means "unknown".

			regards, tom lane
В списке pgsql-bugs по дате отправления
От: awasarax@yandex.ru
Дата:
Сообщение: BUG #13768: JSONB concat
От: wcatron@catrondevelopment.com
Дата:
FAQ