From 46c3e29b8e63739c17fbacc5fdcb01c9ba0d153c Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Wed, 24 Mar 2004 03:10:29 +0000
Subject: [PATCH] >>Also, what is the default connection mode of psql? It
 should probably be >>equivalent to "-h localhost", shouldn't it? >> >> > >Now
 that is something I had not thought of.  Seems we can assume a Win32 >psql
 can never use unix domain sockets, so defaulting that to localhost >is a good
 solution too.

Andrew Dunstan
---
 src/bin/psql/startup.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 03f4e97d918..4991c7b7456 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2000-2003, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.86 2004/03/21 22:29:11 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.87 2004/03/24 03:10:29 momjian Exp $
  */
 #include "postgres_fe.h"
 
@@ -154,6 +154,11 @@ main(int argc, char *argv[])
 	pset.getPassword = false;
 #endif
 
+#ifndef HAVE_UNIX_SOCKETS
+	/* default to localhost on platforms without unix sockets */
+	options.host = "localhost";
+#endif
+
 	parse_psql_options(argc, argv, &options);
 
 	if (!pset.popt.topt.fieldSep)
-- 
GitLab