How to implement the skip errors for copy from ?

From: xbzhang <xbzhang(at)kingbase(dot)com(dot)cn>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: How to implement the skip errors for copy from ?
Date: 2014-05-29 07:25:10
Message-ID: 2014052915251039311122@kingbase.com.cn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I want to?implement the skip errors for copy from,lik as :create table A (c int primary key);copy A from stdin;112\.
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 resultwill be that there are two rows in table A: 1 and 2.
how to?implement that ?

张晓博?? 研发二部
北京人大金仓信息技术股份有限公司
地址:北京市海淀区上地西路八号院上地科技大厦4号楼501
邮编:100085
电话:(010) 5885 1118 - 8450
手机:15311394463
邮箱:xbzhang(at)kingbase(dot)com(dot)cn

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dmitry Samonenko 2014-05-29 08:27:50 Re: Fwd: libpq: indefinite block on poll during network problems
Previous Message Tom Lane 2014-05-29 03:28:47 Re: Error while upgrading from 8.4 to 9.3