问题
My original sql:
INSERT INTO clients (name, phone) VALUES ('Vs'emandon', '333026660');
I read about E'' and tried this:
INSERT INTO clients (name) VALUES ('VsE'''emandon);
But this not working.
http://www.sqlfiddle.com/#!15/f717e/2
回答1:
Postgres follows the SQL standard.
Quote from the manual:
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 ("
).
INSERT INTO clients (name, phone) VALUES ('Vs''emandon', '333026660');
来源:https://stackoverflow.com/questions/26182711/postgresql-how-escape