Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit db16e77

Browse files
committed
Remove our inadequate kluge that tried to get AIX's various broken versions
of getaddrinfo() to work. Instead, recommend updating the OS to get a working version of getaddrinfo. Per recent discussions.
1 parent d94582f commit db16e77

File tree

2 files changed

+65
-88
lines changed

2 files changed

+65
-88
lines changed

doc/src/sgml/installation.sgml

+64-51
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.321 2009/04/27 16:27:35 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.322 2009/06/11 19:00:14 tgl Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -2090,7 +2090,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
20902090

20912091
<para>
20922092
On AIX 4.3.2, you need <filename>libm.a</filename> that is in the
2093-
fileset bos.adt.libm. Try the following command:
2093+
fileset <literal>bos.adt.libm</>. Try the following command:
20942094
<screen>
20952095
$ lslpp -l bos.adt.libm
20962096
</screen>
@@ -2120,11 +2120,11 @@ $ lslpp -l bos.adt.libm
21202120

21212121
<para>
21222122
AIX 5.3 has a problem
2123-
where <structname>sockadr_storage</structname> is not defined to
2123+
where <structname>sockaddr_storage</structname> is not defined to
21242124
be large enough. In version 5.3, IBM increased the size of
21252125
<structname>sockaddr_un</structname>, the address structure for
21262126
Unix-domain sockets, but did not correspondingly increase the
2127-
size of <structname>sockadr_storage</structname>. The result of
2127+
size of <structname>sockaddr_storage</structname>. The result of
21282128
this is that attempts to use Unix-domain sockets with PostgreSQL
21292129
lead to libpq overflowing the data structure. TCP/IP connections
21302130
work OK, but not Unix-domain sockets, which prevents the
@@ -2142,7 +2142,66 @@ $ lslpp -l bos.adt.libm
21422142
</sect3>
21432143

21442144
<sect3>
2145-
<title>Memory Management</title>
2145+
<title>Internet address issues</title>
2146+
2147+
<para>
2148+
PostgreSQL relies on the system's <function>getaddrinfo</> function
2149+
to parse IP addresses in <varname>listen_addresses</>,
2150+
<filename>pg_hba.conf</>, etc. Older versions of AIX have assorted
2151+
bugs in this function. If you have problems related to these settings,
2152+
updating to the latest fix pack for your AIX release should fix it.
2153+
</para>
2154+
2155+
<!-- http://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
2156+
2157+
<para>
2158+
One user reports:
2159+
</para>
2160+
2161+
<para>
2162+
When implementing PostgreSQL version 8.1 on AIX 5.3, we
2163+
periodically ran into problems where the statistics collector
2164+
would <quote>mysteriously</quote> not come up successfully. This
2165+
appears to be the result of unexpected behaviour in the IPv6
2166+
implementation. It looks like PostgreSQL and IPv6 do not play
2167+
very well together at this time on AIX.
2168+
</para>
2169+
2170+
<para>
2171+
Any of the following actions <quote>fix</quote> the problem.
2172+
<itemizedlist>
2173+
<listitem>
2174+
<para>
2175+
Delete the IPv6 address for localhost:
2176+
<screen>
2177+
(as root)
2178+
# ifconfig lo0 inet6 ::1/0 delete
2179+
</screen>
2180+
</para>
2181+
</listitem>
2182+
2183+
<listitem>
2184+
<para>
2185+
Remove IPv6 from net services. The
2186+
file <filename>/etc/netsvc.conf</filename> on AIX is roughly
2187+
equivalent to <filename>/etc/nsswitch.conf</filename> on
2188+
Solaris/Linux. The default, on AIX, is thus:
2189+
<programlisting>
2190+
hosts=local,bind
2191+
</programlisting>
2192+
Replace this with:
2193+
<programlisting>
2194+
hosts=local4,bind4
2195+
</programlisting>
2196+
to deactivate searching for IPv6 addresses.
2197+
</para>
2198+
</listitem>
2199+
</itemizedlist>
2200+
</para>
2201+
</sect3>
2202+
2203+
<sect3>
2204+
<title>Memory management</title>
21462205
<!-- http://archives.postgresql.org/message-id/603bgqmpl9.fsf@dba2.int.libertyrms.com -->
21472206

21482207
<para>
@@ -2292,52 +2351,6 @@ createlang: language installation failed: ERROR: could not load library "/opt/d
22922351
</biblioentry>
22932352
</bibliography>
22942353
</sect3>
2295-
2296-
<sect3>
2297-
<title>Statistics Collector Issues</title>
2298-
<!-- http://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
2299-
2300-
<para>
2301-
When implementing PostgreSQL version 8.1 on AIX 5.3, we
2302-
periodically ran into problems where the statistics collector
2303-
would <quote>mysteriously</quote> not come up successfully. This
2304-
appears to be the result of unexpected behaviour in the IPv6
2305-
implementation. It looks like PostgreSQL and IPv6 do not play
2306-
very well together at this time on AIX.
2307-
</para>
2308-
2309-
<para>
2310-
Any of the following actions <quote>fix</quote> the problem.
2311-
<itemizedlist>
2312-
<listitem>
2313-
<para>
2314-
Delete the IPv6 address for localhost:
2315-
<screen>
2316-
(as root)
2317-
# ifconfig lo0 inet6 ::1/0 delete
2318-
</screen>
2319-
</para>
2320-
</listitem>
2321-
2322-
<listitem>
2323-
<para>
2324-
Remove IPv6 from net services. The
2325-
file <filename>/etc/netsvc.conf</filename> on AIX is roughly
2326-
equivalent to <filename>/etc/nsswitch.conf</filename> on
2327-
Solaris/Linux. The default, on AIX, is thus:
2328-
<programlisting>
2329-
hosts=local,bind
2330-
</programlisting>
2331-
Replace this with:
2332-
<programlisting>
2333-
hosts=local4,bind4
2334-
</programlisting>
2335-
to deactivate searching for IPv6 addresses.
2336-
</para>
2337-
</listitem>
2338-
</itemizedlist>
2339-
</para>
2340-
</sect3>
23412354
</sect2>
23422355

23432356
<sect2 id="installation-notes-cygwin">

src/backend/libpq/ip.c

+1-37
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.46 2009/06/11 14:48:58 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.47 2009/06/11 19:00:15 tgl Exp $
1212
*
1313
* This file and the IPV6 implementation were initially provided by
1414
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
@@ -74,45 +74,9 @@ pg_getaddrinfo_all(const char *hostname, const char *servname,
7474
return getaddrinfo_unix(servname, hintp, result);
7575
#endif
7676

77-
#ifndef _AIX
7877
/* NULL has special meaning to getaddrinfo(). */
7978
rc = getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname,
8079
servname, hintp, result);
81-
#else /* _AIX */
82-
83-
/*
84-
* Various versions of AIX have various bugs in getaddrinfo()'s handling
85-
* of the servname parameter, including failing entirely if it's not NULL
86-
* and failing to zero sin_port when it is NULL :-(. Avoid these by
87-
* always passing NULL and handling the port number for ourselves.
88-
*/
89-
rc = getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname,
90-
NULL, hintp, result);
91-
92-
if (rc == 0)
93-
{
94-
struct addrinfo *addr;
95-
unsigned short port = 0;
96-
97-
if (servname && *servname)
98-
port = atoi(servname);
99-
100-
for (addr = *result; addr; addr = addr->ai_next)
101-
{
102-
switch (addr->ai_family)
103-
{
104-
case AF_INET:
105-
((struct sockaddr_in *) addr->ai_addr)->sin_port = htons(port);
106-
break;
107-
#ifdef HAVE_IPV6
108-
case AF_INET6:
109-
((struct sockaddr_in6 *) addr->ai_addr)->sin6_port = htons(port);
110-
break;
111-
#endif
112-
}
113-
}
114-
}
115-
#endif /* _AIX */
11680

11781
return rc;
11882
}

0 commit comments

Comments
 (0)