X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0CCB1DA724 for ; Thu, 20 Oct 2005 03:18:39 -0300 (ADT) 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 99191-03 for ; Thu, 20 Oct 2005 06:18:36 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id D182ADA243 for ; Thu, 20 Oct 2005 03:18:36 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9K6ISu4095287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Oct 2005 00:18:32 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id j9K6ISJW073358; Thu, 20 Oct 2005 00:18:28 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id j9K6IQYH073357; Thu, 20 Oct 2005 00:18:26 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 20 Oct 2005 00:18:26 -0600 From: Michael Fuhr To: sandhya Cc: postgre Subject: Re: Reg : Error Handling Message-ID: <20051020061825.GA71430@winnie.fuhr.org> References: <057401c5d497$a25e81e0$cd00000a@amiindiahjwbgh> <20051019172507.GA72974@winnie.fuhr.org> <00b401c5d537$9503a9d0$cd00000a@amiindiahjwbgh> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00b401c5d537$9503a9d0$cd00000a@amiindiahjwbgh> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/227 X-Sequence-Number: 19299 On Thu, Oct 20, 2005 at 10:30:36AM +0530, sandhya wrote: > I am able to get the error code as a return value from the function using, > return (PQresultErrorField(res,PG_DIAG_SQLSTATE)); > Problem is i don't know how to generalize the messages once i get > this....Pls any one help me in this regard The "PostgreSQL Error Codes" appendix to the documentation explains what each SQLSTATE code means: http://www.postgresql.org/docs/8.0/interactive/errcodes-appendix.html See also server/utils/errcodes.h. I haven't found anywhere in the source code that provides mappings from SQLSTATE to generic messages, so you'll probably have to do that yourself. -- Michael Fuhr