Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: PQhost() Returns NULL on Connection



Keary Suska <hierophant(at)pcisys(dot)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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group