Re: missing something about json syntax

2023-04-21 Thread Marc Millas
Ok, thanks. Le jeu. 20 avr. 2023 à 22:42, Tom Lane a écrit : > Marc Millas writes: > > but it doesnt explain how postgres is able to put a scalar in a json or > > jsonb column without pb: > > I don't understand how this ('"{\"t\"}"') can be considered a valid > enough > > json to be inserted i

Re: missing something about json syntax

2023-04-20 Thread Tom Lane
Marc Millas writes: > but it doesnt explain how postgres is able to put a scalar in a json or > jsonb column without pb: > I don't understand how this ('"{\"t\"}"') can be considered a valid enough > json to be inserted in a json column > and at the same time invalid for all other json uses. Tha

Re: missing something about json syntax

2023-04-20 Thread Marc Millas
Thanks for your input. select (_data->>'log')::json->'level' from mytable; this does work. but it doesnt explain how postgres is able to put a scalar in a json or jsonb column without pb: I don't understand how this ('"{\"t\"}"') can be considered a valid enough json to be inserted in a json colu

Re: missing something about json syntax

2023-04-20 Thread Erik Wienhold
> On 20/04/2023 18:35 CEST Marc Millas wrote: > > Hi, > > postgres 15 > > looks Iike I am missing something, maybe obvious :-( > In a table with a json column (_data) if I ask psql to select _data from > mytable with a where clause to get only one line,, I get something beginning > by > {"time":"2

missing something about json syntax

2023-04-20 Thread Marc Millas
Hi, postgres 15 looks Iike I am missing something, maybe obvious :-( In a table with a json column (_data) if I ask psql to select _data from mytable with a where clause to get only one line,, I get something beginning by {"time":"2023-04-19T16:28:01.19780551+02:00","stream":"stderr","_p":"F","