copy使用 insert into toids select from t; INSERT 0 4 teledb copy toids to '/home/teledb/t.txt' with oids csv; COPY 4 teledb ! cat /home/teledb/t.txt 33178,1,张三,20001201 00:00:00,北京 33179,2,李四,19970324 00:00:00,上海 33178,3,王五,20040901 00:00:00,广州 33179,4,赵六,20001201 00:00:00, 创建表时使用了with oids才能使用oids选项 使用quote自定义引用字符 plaintext teledb update t set city '"杭州"' where id 3; UPDATE 1 teledb copy t to '/home/teledb/t.txt' with csv; 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,"""杭州""" 默认引用字符为双引号 。 plaintext teledb update t set city '"杭州%' where id 3; UPDATE 1 teledb copy t to '/home/teledb/t.txt' with quote '%' csv; 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,%"杭州%%% 上面指定了引用字符为百分号,系统自动把字段值为%的字符替换为双个%。 plaintext teledb
来自: