I created a table has a column store text data. I want to get specified text value from the column. I want to get PAYMENTDATE value. How can I do?
"{"SALEDATE":"2017-11-01 12:46:29","PAYMENTDATE":"2017-11-01 12:50:49"}"
If you trim the leading and trailing " from the string, you'll have a json-formatted string. You could then just cast it to json and use the ->> operator to extract data from it:
SELECT TRIM(BOTH '"' FROM mycol)::JSON->>'PAYMENTDATE'
FROM mytable
" are the result from printing the field content.trim call
text_data::JSON