Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id C685E2E01C8 for ; Wed, 14 May 2008 12:18:06 -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 25597-04-4 for ; Wed, 14 May 2008 12:17:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 585A72E020B for ; Wed, 14 May 2008 12:01:39 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m4EF1aJF019620; Wed, 14 May 2008 11:01:36 -0400 (EDT) To: Julius Tuskenis cc: pgsql-admin@postgresql.org Subject: Re: translating exception messages of postgresql functions In-reply-to: <482AF7F7.5090309@nsoft.lt> References: <482AF7F7.5090309@nsoft.lt> Comments: In-reply-to Julius Tuskenis message dated "Wed, 14 May 2008 17:32:23 +0300" Date: Wed, 14 May 2008 11:01:36 -0400 Message-ID: <19619.1210777296@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/118 X-Sequence-Number: 29202 Julius Tuskenis writes: > As I've read - postgresql always generates P0001 SQLSTATE code for > raised exceptions. Have enyone tried to distinguish one exception from > the other in the application? You'd have to rely on looking at the error message text. 8.4 will let you specify SQLSTATE in RAISE: http://developer.postgresql.org/pgdocs/postgres/plpgsql-errors-and-messages.html regards, tom lane