X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2C85B8B9B26 for ; Tue, 8 Feb 2005 10:26:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00435-01 for ; Tue, 8 Feb 2005 10:25:56 +0000 (GMT) Received: from termit.gingerall.cz (termit.gingerall.cz [213.195.208.132]) by svr1.postgresql.org (Postfix) with ESMTP id 12BBF8B9C33 for ; Tue, 8 Feb 2005 10:25:57 +0000 (GMT) Received: from [213.195.208.156] (balvan.gingerall.cz [213.195.208.156]) (authenticated bits=0) by termit.gingerall.cz (8.12.11/8.12.11) with ESMTP id j18APlq1028877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Feb 2005 11:25:47 +0100 Message-ID: <420893AB.7030201@gingerall.cz> Date: Tue, 08 Feb 2005 11:25:47 +0100 From: Jan Poslusny User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Surabhi Ahuja Cc: pgsql-general@postgresql.org Subject: Re: References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/409 X-Sequence-Number: 73213 If you want to realize your insert chain in plpgsql, trapping exceptions is a good idea, imho. But I am not experienced with these new features in pg 8.0 ... Surabhi Ahuja wrote: > cant the same be done by trapping the errors. by trapping these > exceptions? > http://www.postgresql.org/docs/8.0/interactive/plpgsql-control-structures.html > > search for "trapping errors" ? > > ------------------------------------------------------------------------ > *From:* Jan Poslusny [mailto:pajout@gingerall.cz] > *Sent:* Tue 2/8/2005 3:30 PM > *To:* Surabhi Ahuja > *Cc:* pgsql-general@postgresql.org > *Subject:* Re: [GENERAL] > > *********************** > Your mail has been scanned by InterScan VirusWall. > ***********-*********** > > > You can use savepoints in pg 8.0: > http://www.postgresql.org/docs/8.0/static/sql-savepoint.html > > Surabhi Ahuja wrote: > > > in a transaction i try to insert into a table1, followed by insert > > into table 2 then insert into table 3 and last insert into table 4. > > However if a unique key violation occurs in the table 1 , the whole > > trabnsaction aborts. is there no way , where i can ignore this > > violation, and continue with the remaining insertions. > > ? > > >