Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id AB7092E008A for ; Tue, 10 Jun 2008 14:52:56 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11842-09-2 for ; Tue, 10 Jun 2008 14:52:44 -0300 (ADT) X-Greylist: delayed 01:00:03.27822 by SQLgrey-1.7.6 Received: from mongonet.net (mailgate.mongonet.net [64.157.94.58]) by developer.postgresql.org (Postfix) with ESMTP id 711552E0087 for ; Tue, 10 Jun 2008 14:52:44 -0300 (ADT) Received: from [192.168.1.121] (account dbhandary [192.168.1.121] verified) by mongonet.net (CommuniGate Pro SMTP 5.1.12) with ESMTPSA id 3856500 for pgsql-admin@postgresql.org; Tue, 10 Jun 2008 09:52:38 -0700 Message-ID: <484EB14B.4010003@mongonet.net> Date: Tue, 10 Jun 2008 09:52:27 -0700 From: Dinesh User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: error handling unique key constraint in pgsql Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/78 X-Sequence-Number: 29416 Hi All, I was wondering if there is an easy way to handle unique key constraint in pgsql. Right now my entire transaction aborts if it tries to insert duplicate keys, but I would like to handle this scenario in such a way that the transaction will not break. Please let me know if you have done something like this. I greatly appreciate your help. Thanks, Dinesh