X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7EFC011F6A9F for ; Wed, 26 Apr 2006 21:00:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 90915-06 for ; Wed, 26 Apr 2006 20:59:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7A76B11F60E5 for ; Wed, 26 Apr 2006 20:59:49 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3QNxcgp000610; Wed, 26 Apr 2006 19:59:38 -0400 (EDT) To: Keary Suska cc: Postgres-Interfaces Subject: Re: PQhost() Returns NULL on Connection In-reply-to: References: Comments: In-reply-to Keary Suska message dated "Wed, 26 Apr 2006 14:08:40 -0600" Date: Wed, 26 Apr 2006 19:59:38 -0400 Message-ID: <609.1146095978@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/28 X-Sequence-Number: 6119 Keary Suska writes: > Why would PQhost() return NULL on a valid connection? One reason why would be if you'd selected the server by hostaddr rather than host. Returning a host name in this case would require a DNS lookup, and since the entire point of the hostaddr feature is to avoid DNS lookups, I don't think that's a particularly great idea. These functions are really defined as "give me back the connection options that were specified", anyway, not "peek inside to see what values are actually in use". So a NULL for an unspecified option seems reasonable to me. regards, tom lane