Insert text with single quotes in PostgreSQL

后端 未结 7 2169
北海茫月
北海茫月 2020-11-21 11:28

I have a table test(id,name).

I need to insert values like: user\'s log, \'my user\', customer\'s.



        
7条回答
  •  春和景丽
    2020-11-21 11:48

    If you need to get the work done inside Pg:

    to_json(value)

    https://www.postgresql.org/docs/9.3/static/functions-json.html#FUNCTIONS-JSON-TABLE

提交回复
热议问题