How to ignore errors with psql \copy meta-command
问题 I am using psql with a PostgreSQL database and the following copy command: \COPY isa (np1, np2, sentence) FROM 'c:\Downloads\isa.txt' WITH DELIMITER '|' I get: ERROR: extra data after last expected column How can I skip the lines with errors? 回答1: You cannot skip the errors without skipping the whole command up to and including Postgres 9.5. There is currently no more sophisticated error handling. \copy is just a wrapper around SQL COPY that channels results through psql. The manual for COPY