postgresql/src/bin
Tom Lane 40cb21f70b Improve PQhost() to return useful data for default Unix-socket connections.
Previously, if no host information had been specified at connection time,
PQhost() would return NULL (unless you are on Windows, in which case you
got "localhost").  This is an unhelpful definition for a couple of reasons:
it can cause corner-case crashes in applications (cf commit c5ef8ce53d),
and there's no well-defined way for applications to find out the socket
directory path that's actually in use.  As an example of the latter
problem, psql substituted DEFAULT_PGSOCKET_DIR for NULL in a couple of
places, but this is subtly wrong because it's conceivable that psql is
using a libpq shared library that was built with a different setting.

Hence, change PQhost() to return DEFAULT_PGSOCKET_DIR when appropriate,
and strip out the now-dead substitutions in psql.  (There is still one
remaining reference to DEFAULT_PGSOCKET_DIR in psql, in prompt.c, which
I don't see a nice way to get rid of.  But it only controls a prompt
abbreviation decision, so it seems noncritical.)

Also update the docs for PQhost, which had never previously mentioned
the possibility of a socket directory path being returned.  In passing
fix the outright-incorrect code comment about PGconn.pgunixsocket.
2015-11-27 14:13:53 -05:00
..
initdb Translation updates 2015-06-28 23:56:55 -04:00
pg_archivecleanup Make WAL-related utilities handle .partial WAL files properly. 2015-07-03 11:53:58 +09:00
pg_basebackup Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
pg_config Translation updates 2015-06-28 23:56:55 -04:00
pg_controldata Make pg_controldata report newest XID with valid commit timestamp 2015-09-24 23:31:17 +09:00
pg_ctl Don't connect() to a wildcard address in test_postmaster_connection(). 2015-11-08 17:28:53 -05:00
pg_dump Adopt the GNU convention for handling tar-archive members exceeding 8GB. 2015-11-21 20:21:31 -05:00
pg_resetxlog Make pg_controldata report newest XID with valid commit timestamp 2015-09-24 23:31:17 +09:00
pg_rewind pg_rewind: Improve some messages 2015-10-01 21:42:00 -04:00
pg_test_fsync Move pg_test_fsync from contrib/ to src/bin/ 2015-04-19 22:20:49 -04:00
pg_test_timing Move pg_test_timing from contrib/ to src/bin/ 2015-04-20 21:30:12 -04:00
pg_upgrade pg_upgrade: fix CopyFile() on Windows to fail on file existence 2015-11-24 17:18:28 -05:00
pg_xlogdump Improve includes introduced in the replication origins patch. 2015-08-06 12:41:46 +02:00
pgbench Fix incorrect tps number calculation in "excluding connections establishing". 2015-09-30 10:53:31 +09:00
pgevent Update copyright for 2015 2015-01-06 11:43:47 -05:00
psql Improve PQhost() to return useful data for default Unix-socket connections. 2015-11-27 14:13:53 -05:00
scripts Improve message 2015-11-16 22:26:32 -05:00
Makefile Move pg_xlogdump from contrib/ to src/bin/ 2015-04-21 19:03:49 -04:00