Json value may consist of a string value. eg.:
postgres=# SELECT to_json('Some "text"'::TEXT);
to_json
-----------------
"Some "text""
How can I extract that string as a postgres text value?
::TEXT
doesn't work. It returns quoted json, not the original string:
postgres=# SELECT to_json('Some "text"'::TEXT)::TEXT;
to_json
-----------------
"Some "text""
Thanks.
P.S. I'm using PostgreSQL 9.3
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…