[postgresql] Postgres 프런트 엔드에서 탭을 지정하는 방법

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, e.g., 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')


답변