X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B366B11F68C7 for ; Wed, 5 Apr 2006 11:30:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74182-08 for ; Wed, 5 Apr 2006 11:30:21 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 7F86811F6780 for ; Wed, 5 Apr 2006 11:30:19 -0300 (ADT) Received: from hyperion.stayhosted.com (hyperion.stayhosted.com [70.84.193.98]) by svr4.postgresql.org (Postfix) with ESMTP id 78D415AF868 for ; Wed, 5 Apr 2006 14:30:16 +0000 (GMT) Received: from host86-143-157-186.range86-143.btcentralplus.com ([86.143.157.186]) by hyperion.stayhosted.com with esmtpa (Exim 4.52) id 1FR91C-000292-MS for pgsql-interfaces@postgresql.org; Wed, 05 Apr 2006 14:30:10 +0000 Message-ID: <4433D44E.9040005@1nsp1r3d.co.uk> Date: Wed, 05 Apr 2006 15:29:34 +0100 From: Milen Dzhumerov User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: PQconnectdb et.all. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hyperion.stayhosted.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - 1nsp1r3d.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200604/11 X-Sequence-Number: 6102 Danny Braniss wrote: > How can I programatically figure out why PQconnectdb failed? > The reason for this is that my daemon needs to know: > 1- if to try and reconnect (for example, if it's timing out) > 2- abandom, if for example it has not permition. > thanks, > danny > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > > Just determine the SQLState from the last operation and use this table http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html Regards, gamehack