How to implement the skip errors for copy from ? - Mailing list pgsql-hackers

From xbzhang
Subject How to implement the skip errors for copy from ?
Date
Msg-id 2014061617463628926328@kingbase.com.cn
Whole thread Raw
Responses Re: How to implement the skip errors for copy from ?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers

I want to implement the skip errors for copy from,lik as :
create table A (c int primary key);
copy A from stdin;
1
1
2
\.

copy will failed:
ERROR: duplicate key violates primary key constraint "CC_PKEY" 
CONTEXT: COPY CC, line 2: "1"

I want skip the error, and continue to copy the reset of tuple. The result
will be that there are two rows in table A: 1 and 2.

how to implement that ? Anybody give me some suggestion?


张晓博   研发二部

北京人大金仓信息技术股份有限公司

地址:北京市海淀区上地西路八号院上地科技大厦4号楼501

邮编:100085

电话:(010) 5885 1118 - 8450

手机:15311394463

邮箱:xbzhang@kingbase.com.cn

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: postgresql.auto.conf read from wrong directory
Next
From: Pavel Stehule
Date:
Subject: Re: How to implement the skip errors for copy from ?