From: Tom Lane <tgl@sss.pgh.pa.us>
To: Keary Suska <hierophant@pcisys.net>
Cc: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: PQhost() Returns NULL on Connection
Date: Wed, 26 Apr 2006 19:59:38 -0400
Message-ID: <609.1146095978@sss.pgh.pa.us> (raw)
In-Reply-To: <C0752F68.29071%hierophant@pcisys.net>
References: <C0752F68.29071%hierophant@pcisys.net>
Keary Suska <hierophant@pcisys.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, hierophant@pcisys.net
Subject: Re: PQhost() Returns NULL on Connection
In-Reply-To: <609.1146095978@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox