Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDaQb-002VUJ-Eo for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 01:22:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rDaQZ-002HlI-Vm for pgsql-bugs@arkaria.postgresql.org; Thu, 14 Dec 2023 01:22:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <13325718563@189.cn>) id 1rDaA4-002A5E-PM for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 01:05:12 +0000 Received: from ptr.189.cn ([183.61.185.104] helo=189.cn) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from <13325718563@189.cn>) id 1rDa9x-00AHMa-4w for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 01:05:10 +0000 HMM_SOURCE_IP: 10.64.8.31:34506.1330180083 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-202.96.99.160 (unknown [10.64.8.31]) by 189.cn (HERMES) with SMTP id 3254110291B for ; Thu, 14 Dec 2023 09:04:55 +0800 (CST) Received: from ([202.96.99.160]) by gateway-151646-dep-5774989467-dzzpg with ESMTP id dbeb4c5c924d44ddafd5e90d48c1531f for pgsql-bugs@lists.postgresql.org; Thu, 14 Dec 2023 09:04:56 CST X-Transaction-ID: dbeb4c5c924d44ddafd5e90d48c1531f X-Real-From: 13325718563@189.cn X-Receive-IP: 202.96.99.160 X-MEDUSA-Status: 0 Sender: 13325718563@189.cn From: =?gb2312?B?uN/J/Q==?= <13325718563@189.cn> To: Subject: about psql copy ,we would like to seek help,Thanks. Date: Thu, 14 Dec 2023 09:04:55 +0800 Message-ID: <000301da2e29$8d2a7e00$a77f7a00$@cn> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0004_01DA2E6C.9B4DBE00" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdouKYyOEKnyUeIOSJ6/trxixs/W/w== Content-Language: zh-cn List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 这是一封 MIME 格式的多部分邮件。 ------=_NextPart_000_0004_01DA2E6C.9B4DBE00 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit PSQL engineers, hello: We encountered a problem during the process of importing data from a text file to the PG database using psql's COPY command, and we would like to seek help. The issue is that if there are any exceptional records in the file, the program exits, but we want to skip those erroneous records and continue with the rest of the import. We have looked at some tutorials, and it seems that we can use the "CONTINUE" option. By using the CONTINUE option, the COPY command should ignore error rows and continue with the copying operation until all rows are copied. The relevant error information for the error rows will be recorded. COPY table_name FROM '/path/to/data/file.csv' (FORMAT csv, DELIMITER ',', NULL '', CONTINUE); However, when we actually tried this, an error occurred, and it seems that the parameter is not recognized. ERROR: option "continue" not recognized My psql version : psql (PostgreSQL) 12.7 Could this be due to the version? Are there any other ways to handle this? Thank you for your support. Best Regards. Gaosheng 2023-12-14 from China ------=_NextPart_000_0004_01DA2E6C.9B4DBE00 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

PSQL engineers, hello: =

We = encountered a problem during the process of importing data from a text file to the PG database using psql's COPY command, and we would like to seek help. The = issue is that if there are any exceptional records in the file, the program = exits, but we want to skip those erroneous records and continue with the rest = of the import.

We = have looked at some tutorials, and it seems that we can use the "CONTINUE" option. By using the CONTINUE option, the COPY command should ignore = error rows and continue with the copying operation until all rows are copied. The = relevant error information for the error rows will be recorded. =

COPY table_name FROM '/path/to/data/file.csv' (FORMAT csv, DELIMITER ',', NULL '', = CONTINUE);

However, when we actually tried this, an error occurred, and it seems that the parameter = is not recognized.

ERROR: option "continue" not recognized

 

My = psql version : psql (PostgreSQL) 12.7

 

 

 

Could this be due to the version? Are there any other ways to handle this? Thank you = for your support.

 

Best = Regards.

Gaosheng

2023-12-14 from = China

------=_NextPart_000_0004_01DA2E6C.9B4DBE00--