Reported by:

r2py@cs.cmu.edu

Date:

Thu May 18 16:17:38 PDT 1995

Description

The monitor program didn't allow use of "localhost" no matter what you tried. It insisted on getting the hostname and using it if you tried -h localhost or setenv PGHOST localhost.

Fix

Apply this patch

*** 1.11        1995/05/10 23:36:21
--- monitor.c   1995/05/18 23:53:32
***************
*** 270,284 ****
      username = usernamebuf;
      
      /*
!      *  Determine the hostname of the database server.  Try to avoid using
!      * "localhost" if at all possible.
       */
      if (!PQhost && !(PQhost = getenv("PGHOST")))
            PQhost = "localhost";
-     if (!strcmp(PQhost, "localhost")) {
-           if (gethostname(hostbuf, MAXHOSTNAMELEN) != -1)
-                   PQhost = hostbuf;
-     }
  
      /* find database */
      if (!(dbname = argv[optind]) &&
--- 270,281 ----
      username = usernamebuf;
      
      /*
!      *  Determine the hostname of the database server. 
!      * Use the PGHOST environment variable if necessary
!      * if all else fails, use 'localhost'
       */
      if (!PQhost && !(PQhost = getenv("PGHOST")))
            PQhost = "localhost";
  
      /* find database */
      if (!(dbname = argv[optind]) &&