Insert text with single quotes in PostgreSQL

后端 未结 7 2156
北海茫月
北海茫月 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:52

    In postgresql if you want to insert values with ' in it then for this you have to give extra '

     insert into test values (1,'user''s log');
     insert into test values (2,'''my users''');
     insert into test values (3,'customer''s');
    

提交回复
热议问题