尝试将转义字符插入表格中会导致警告。
例如:
create table EscapeTest (text varchar(50));
insert into EscapeTest (text) values ('This is the first part \n And this is the second');
产生警告:
WARNING: nonstandard use of escape in a string literal
(使用PSQL 8.2)
有人知道如何解决这个问题吗?
E'\n'
作为psql的\copy
元命令时,它被写入文件时会被写成'\n'
而不是换行符。 - Stew