how to correctly cast json value to text?
От
Pavel Stehule
Тема
how to correctly cast json value to text?
Дата
Msg-id
CAFj8pRB-DdiBWH-e-0WC4VAkDOXW4FdBPBU28c0jAMm4bpf9QA@mail.gmail.com
Список
Дерево обсуждения
how to correctly cast json value to text? Pavel Stehule <pavel.stehule@gmail.com>
Re: how to correctly cast json value to text? Pavel Stehule <pavel.stehule@gmail.com>
Re: how to correctly cast json value to text? Marko Tiikkaja <marko@joh.to>
Re: how to correctly cast json value to text? Pavel Stehule <pavel.stehule@gmail.com>
Hi
I am testing a new subscripting interface for jsonb, and I found one issue.
DO $$
DECLARE v jsonb;
BEGIN
v['a'] = '"Ahoj"';
RAISE NOTICE '%', v['a'];
END;
$$;
NOTICE: "Ahoj"
DO
DECLARE v jsonb;
BEGIN
v['a'] = '"Ahoj"';
RAISE NOTICE '%', v['a'];
END;
$$;
NOTICE: "Ahoj"
DO
When I use this interface for reading, the jsonb type is returned. What is the correct way for casting from jsonb text to text value? I would not double quotes inside the result. Cast to text doesn't help. For operator API we can use "->>" symbol. But we have nothing similar for subscript API.
Regards
Pavel
В списке pgsql-hackers по дате отправления
От: Dilip Kumar
Дата: