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 6632811F65FD for ; Wed, 29 Mar 2006 17:18:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33355-06 for ; Wed, 29 Mar 2006 17:18:49 -0400 (AST) X-Greylist: delayed 04:23:12.386771 by SQLgrey- Received: from marsha.pcisys.net (marsha.pcisys.net [216.229.32.146]) by postgresql.org (Postfix) with ESMTP id 872FE11F65FA for ; Wed, 29 Mar 2006 17:18:48 -0400 (AST) Received: from [192.168.0.101] (dsl-206-53-30-61.cos.pcisys.net [206.53.30.61]) by marsha.pcisys.net (8.13.3/8.13.3) with ESMTP id k2TLIlR7026002 for ; Wed, 29 Mar 2006 14:18:47 -0700 (MST) User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Wed, 29 Mar 2006 14:18:46 -0700 Subject: Re: Libpq and PGConn From: Keary Suska To: Postgres-Interfaces Message-ID: In-Reply-To: <22965.1143652556@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.14 required=5 tests=[AWL=0.140] X-Spam-Score: 0.14 X-Spam-Level: X-Archive-Number: 200603/29 X-Sequence-Number: 6085 on 3/29/06 10:15 AM, tgl@sss.pgh.pa.us purportedly said: > Keary Suska writes: >> What happens if a null pointer is sent to any libpq function for the PGConn >> parameter? > > AFAIR they all check for that and fail in a reasonably clean fashion. > Have you found one that doesn't? Not as of yet. I am building a custom wrapper to libpq and trying to account for situations such as an attempt to call a libpq function on a PGconn object that has not been initialized, such as returned from PQconnectdb and the like. Same goes for PGresult objects. Is it safe to assume that in these cases--where a PGconn or Pgresult has not been initialized, but has not been finished() either--that all functions won't (or shouldn't) choke, will set an error message, and return a defined value? Thanks, Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business"