Re: Stats Collector Won't Start - Mailing list pgsql-general

From Tom Lane
Subject Re: Stats Collector Won't Start
Date
Msg-id 27202.1161276201@sss.pgh.pa.us
Whole thread Raw
In response to Re: Stats Collector Won't Start  (Chris Browne <cbbrowne@acm.org>)
List pgsql-general
Chris Browne <cbbrowne@acm.org> writes:
> Is there a more elegant way of setting the requested port to 0 than my
> 2-liner?

What I'm tempted to do is add this to pg_getaddrinfo_all (in
src/backend/libpq/ip.c):

  {
      /* not all versions of getaddrinfo() zero *result on failure */
      *result = NULL;

+ #ifdef _AIX
+    /* it seems AIX's getaddrinfo doesn't reliably zero sin_port */
+    if (servname == NULL)
+        servname = "0";
+ #endif
+
  #ifdef HAVE_UNIX_SOCKETS
      if (hintp->ai_family == AF_UNIX)
          return getaddrinfo_unix(servname, hintp, result);

Want to try that?

            regards, tom lane

pgsql-general by date:

Previous
From: Bob Pawley
Date:
Subject: Re: PostGIS
Next
From: Chris Browne
Date:
Subject: Re: Stats Collector Won't Start