今天有开发人员咨询如何插入包含单引号的字符串,例如 kate’s horse,网上查了下资料,最后还是文档中给出了解释,如下:
单引号的转义
To include a single-quote character within a string constant, write two adjacent single quotes, e.g., ‘Dianne’’s horse’. Note that this is not the same as a double-quote character (“).
备注:文档中说的很清楚,写两个单引号即可,注意不能写成双引号。
测试
1 |
create table test_3(id int4,name text); |
参考
原创文章,作者:sunnyman218,如若转载,请注明出处:https://blog.ytso.com/239582.html