Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8E51D2E0092 for ; Mon, 26 Nov 2007 22:24:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 20447-08 for ; Mon, 26 Nov 2007 22:24:35 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 3E4012E007B for ; Mon, 26 Nov 2007 22:24:35 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id lAR2OXR4008905; Mon, 26 Nov 2007 21:24:33 -0500 (EST) To: Jeffrey Brendecke cc: pgsql-interfaces@postgresql.org Subject: Re: v8.1: Error severity on libpq PGconn* In-reply-to: <315963.85252.qm@web26909.mail.ukl.yahoo.com> References: <315963.85252.qm@web26909.mail.ukl.yahoo.com> Comments: In-reply-to Jeffrey Brendecke message dated "Mon, 26 Nov 2007 23:52:50 +0000" Date: Mon, 26 Nov 2007 21:24:33 -0500 Message-ID: <8904.1196130273@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/17 X-Sequence-Number: 6661 Jeffrey Brendecke writes: > Is there a recommended way to get the error severity (ERROR vs. FATAL vs. PANIC, etc.) off a PGconn* as there is for a PGresult* using PQresultErrorField()? > For example, when I pass in a non-existent database name when creating a connection, I get the following message: > FATAL: database "xxxxxx" does not exist What you're really wishing here is that errors generated within libpq itself had SQLSTATE and other decoration. They don't :-(. Improving this is on the to-do list, but someone is going to have to sit down and do several days/weeks of hard and mostly-boring work to make it happen. Do you want to volunteer? regards, tom lane