Received: from thor.tht.net (thor.tht.net [209.47.145.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB8L6PZ09877 for ; Fri, 8 Dec 2000 16:06:25 -0500 (EST) (envelope-from jliang@ipinc.com) Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id RAA15577 for ; Fri, 8 Dec 2000 17:00:58 GMT (envelope-from jliang@ipinc.com) Received: from ipinc.com (jliang.ipinc.com [199.245.188.130]) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id NAA80944 for ; Fri, 8 Dec 2000 13:00:28 -0800 (PST) (envelope-from jliang@ipinc.com) Message-ID: <3A3149D2.4E59DA8E@ipinc.com> Date: Fri, 08 Dec 2000 12:51:30 -0800 From: Jie Liang Organization: ipinc.com X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: plpgsql References: <20001002045414.A6334@s2.enthdimension.com.au> <20001002045620.B6334@s2.enthdimension.com.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200012/62 X-Sequence-Number: 393 > Hi, there, Is there any way to handle exception ( such as cannot insert duplicate key on a unique index) in plpgsql function? I don't want it abort whole transaction instead I want to do something else if it happened, but I don't want to use a select stmt first to waste the time. In Orcale, in plsql we can say, declare begin do something exception do something else end; How to this exception section in plpgsql???? -- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com