copy使用 copy t to '/home/teledb/t.txt' with quote '%' escape '@@' csv; ERROR: COPY escape must be a single onebyte character 只有使用CSV 格式时才允许这个选项。 plaintext teledb copy t to '/home/teledb/t.txt' with quote '%' escape '@@'; ERROR: COPY quote available only in CSV mode 强制给某个列添加引用字符 plaintext teledb copy t to '/home/teledb/t.txt' (format 'csv', forcequote(name)); COPY 4 teledb ! cat /home/teledb/t.txt 1,"张三",20001201 00:00:00,北京 2,"李四",19970324 00:00:00,上海 4,"赵六",20001201 00:00:00, 3,"王五",20040901 00:00:00,%杭州% 指定name列强制添加引用字符。 plaintext teledb copy t to '/home/teledb/t.txt' (format 'text', forcequote(name)); ERROR: COPY force quote available only in CSV mode 只有使用CSV格式时才允许这个选项。 使用encoding指定导出文件内容编码 plaintext teledb copy t to '/home/teledb/t.txt' (encoding utf8); COPY 4 导出文件编码为UTF8。 plaintext teledb copy t to '/home/teledb/t.txt' (encoding gbk); COPY 4 导出文件编码为gbk。 使用set clientencoding to gbk; 也可以将文件的内容设置为需要的编码,如下所示。 plaintext teledb set clientencoding to utf8; SET teledb copy t to '/home/teledb/t.txt' with csv; COPY 4