如何在postgres前端COPY中指定一个选项卡

我想使用psql“\ copy”命令将数据从制表符分隔的文件中提取到Postgres中。 我正在使用这个命令:

\copy cm_state from 'state.data' with delimiter '\t' null as ; 

但我得到这个警告(表格实际加载罚款):

 WARNING: nonstandard use of escape in a string literal LINE 1: COPY cm_state FROM STDIN DELIMITER '\t' NULL AS ';' HINT: Use the escape string syntax for escapes, eg, E'\r\n'. 

如果“\ t”不正确,我如何指定标签?

使用E'\t'告诉postgresql那里可能有逃脱的字符:

 \copy cm_state from 'state.data' with delimiter E'\t' null as ; 

你可以copy cm_state from stdin with (format 'text')