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 151043A56CF for ; Thu, 2 Dec 2004 03:16:43 +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 73307-09 for ; Thu, 2 Dec 2004 03:16:28 +0000 (GMT) Received: from web51106.mail.yahoo.com (web51106.mail.yahoo.com [206.190.38.148]) by svr1.postgresql.org (Postfix) with SMTP id AB8C53A58CF for ; Thu, 2 Dec 2004 03:11:49 +0000 (GMT) Received: (qmail 68003 invoked by uid 60001); 2 Dec 2004 03:11:44 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=J/nm2bx0fo6bLz63K1OvZ/vfrnlL/SpZ74uNKvWs2hYho8P5eWR0ySVSC+AbHJafDclj8FHOnrlCNMrM6v9LeQN/mbWRCuZUtad93PgOGT/g1k8AWHKrQ2JuCChiTkCwLPcptIbAZMGllqjfdHGh7dc2Bu67Fk3kGoQFB2x9r2w= ; Message-ID: <20041202031144.68001.qmail@web51106.mail.yahoo.com> Received: from [64.60.240.34] by web51106.mail.yahoo.com via HTTP; Wed, 01 Dec 2004 19:11:44 PST Date: Wed, 1 Dec 2004 19:11:44 -0800 (PST) From: X X Subject: libpq: how to get error code (not message) To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200412/2 X-Sequence-Number: 5173 Hello, I'm writing a client in C++ using the C-library (libpq) interface to PostgreSQL server. 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'm aware from other postings that in JDBC it would be a getSQLState() call, but what if I have to code the client in C/C++ and use libpq ?) I found that the error codes are defined in file errcodes.h under the /server include directory, but can't find the client-side function that returns them. Any hints are much appreciated, Serge __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail