X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 09C823A56D9 for ; Thu, 2 Dec 2004 06:07:04 +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 30104-01 for ; Thu, 2 Dec 2004 06:06:53 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 773503A5682 for ; Thu, 2 Dec 2004 06:06:52 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iB266n31022861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 1 Dec 2004 23:06:51 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iB266nQq061051; Wed, 1 Dec 2004 23:06:49 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iB266mje061050; Wed, 1 Dec 2004 23:06:48 -0700 (MST) (envelope-from mfuhr) Date: Wed, 1 Dec 2004 23:06:48 -0700 From: Michael Fuhr To: X X Cc: pgsql-interfaces@postgresql.org Subject: Re: libpq: how to get error code (not message) Message-ID: <20041202060648.GA60984@winnie.fuhr.org> References: <20041202031144.68001.qmail@web51106.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041202031144.68001.qmail@web51106.mail.yahoo.com> 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: 200412/3 X-Sequence-Number: 5174 On Wed, Dec 01, 2004 at 07:11:44PM -0800, X X wrote: > I would like to know what function to call to obtain > one of the codes listed at > > http://www.postgresql.org/docs/7.4/static/errcodes-appendix.html I think you're looking for PQresultErrorField() called with the fieldcode argument set to PG_DIAG_SQLSTATE. -- Michael Fuhr http://www.fuhr.org/~mfuhr/