How are jsonb_path_query SRFs $.datetime() defined ?

Поиск
Список
Период
Сортировка
От Markur Sens
Тема How are jsonb_path_query SRFs $.datetime() defined ?
Дата
Msg-id F736DFB9-F796-47EF-A101-DD6B80308A1F@gmail.com
обсуждение исходный текст
Список pgsql-hackers
Hi,

In the regression test I see tests the one below [1], but generally, jsonb_path_query is a SRF,
and the definition in pg_proc.dat has it as such [0], looking at the implementation it doesn’t look like it calls jsonb_query_first behind the scenes (say if it detects it’s being called in  SELECT), which would explain it.

How would I re-create this same behaviour with say another $.func() in jsonb or any SRF in general.

{ oid => '4006', descr => 'jsonpath query',
proname => 'jsonb_path_query', prorows => '1000', proretset => 't',
prorettype => 'jsonb', proargtypes => 'jsonb jsonpath jsonb bool',
prosrc => 'jsonb_path_query' },


select jsonb_path_query('"10-03-2017"', '$.datetime("dd-mm-yyyy")');
jsonb_path_query
------------------
"2017-03-10"
(1 row)

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Should logtape.c blocks be of type long?
Следующее
От: "Karl O. Pinc"
Дата:
Сообщение: Re: Various small doc improvements; plpgsql, schemas, permissions, oidvector