pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Keary Suska <hierophant@pcisys.net>
To: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: PQhost() Returns NULL on Connection
Date: Thu, 27 Apr 2006 10:25:57 -0600
Message-ID: <C0764CB5.29156%hierophant@pcisys.net> (raw)
In-Reply-To: <609.1146095978@sss.pgh.pa.us>

on 4/26/06 5:59 PM, tgl@sss.pgh.pa.us purportedly said:

>> 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.

I wasn't sure, because the behavior is not consistent. For instance,
PQport() will return a value regardless of the connection type and
parameters passed to connect.

Also, there doesn't appear to be a way to retrieve hostaddr even if
specified, so I thought maybe the PQhost() was more generic. E.g. the lib
could return an address if specified and not have to do a wasteful DNS
lookup.

Considering that the connection status functions exist to retrieve parameter
values, it would at least be good to have access to all of them, and not
just a selection of them.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"




view thread (4+ messages)

Message-ID: <C0764CB5.29156%hierophant@pcisys.net>
Permalink:  ../C0764CB5.29156%25hierophant@pcisys.net/
Also on:    postgresql.org/message-id/C0764CB5.29156%hierophant@pcisys.net

 · 

reply

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: hierophant@pcisys.net
  Subject: Re: PQhost() Returns NULL on Connection
  In-Reply-To: <C0764CB5.29156%hierophant@pcisys.net>

* 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