mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Update AIX FAQ:
At any rate, here's a revision to CVS HEAD to reflect some changes by myself and by Seneca Cunningham for the AIX FAQ. It touches on the following issues: 1. memcpy pointer patch for dynahash.c 2. AIX memory management, which can, for 32 bit cases, bite people quite unexpectedly... Chris Browne
This commit is contained in:
9
doc/FAQ
9
doc/FAQ
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Frequently Asked Questions (FAQ) for PostgreSQL
|
Frequently Asked Questions (FAQ) for PostgreSQL
|
||||||
|
|
||||||
Last updated: Sun Apr 2 23:40:12 EDT 2006
|
Last updated: Wed Apr 12 16:03:39 EDT 2006
|
||||||
|
|
||||||
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
||||||
|
|
||||||
@ -25,7 +25,7 @@
|
|||||||
1.9) How do I find out about known bugs or missing features?
|
1.9) How do I find out about known bugs or missing features?
|
||||||
1.10) What documentation is available?
|
1.10) What documentation is available?
|
||||||
1.11) How can I learn SQL?
|
1.11) How can I learn SQL?
|
||||||
1.12) How do I join the development team?
|
1.12) How do I submit a patch or join the development team?
|
||||||
1.13) How does PostgreSQL compare to other DBMSs?
|
1.13) How does PostgreSQL compare to other DBMSs?
|
||||||
|
|
||||||
User Client Questions
|
User Client Questions
|
||||||
@ -275,7 +275,7 @@
|
|||||||
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM,
|
http://ourworld.compuserve.com/homepages/graeme_birchall/HTM_COOK.HTM,
|
||||||
and at http://sqlcourse.com.
|
and at http://sqlcourse.com.
|
||||||
|
|
||||||
1.12) How do I join the development team?
|
1.12) How do I submit a patch or join the development team?
|
||||||
|
|
||||||
See the Developer's FAQ.
|
See the Developer's FAQ.
|
||||||
|
|
||||||
@ -507,7 +507,8 @@
|
|||||||
files so file system size limits are not important.
|
files so file system size limits are not important.
|
||||||
|
|
||||||
The maximum table size, row size, and maximum number of columns can be
|
The maximum table size, row size, and maximum number of columns can be
|
||||||
quadrupled by increasing the default block size to 32k.
|
quadrupled by increasing the default block size to 32k. The maximum
|
||||||
|
table size can also be increased using table partitioning.
|
||||||
|
|
||||||
One limitation is that indexes can not be created on columns longer
|
One limitation is that indexes can not be created on columns longer
|
||||||
than about 2,000 characters. Fortunately, such indexes are rarely
|
than about 2,000 characters. Fortunately, such indexes are rarely
|
||||||
|
182
doc/FAQ_AIX
182
doc/FAQ_AIX
@ -1,5 +1,5 @@
|
|||||||
From: Zeugswetter Andreas <ZeugswetterA@spardat.at>
|
From: Zeugswetter Andreas <ZeugswetterA@spardat.at>
|
||||||
$Date: 2006/04/11 21:23:27 $
|
$Date: 2006/04/13 11:42:35 $
|
||||||
|
|
||||||
On AIX 4.3.2 PostgreSQL compiled with the native IBM compiler xlc
|
On AIX 4.3.2 PostgreSQL compiled with the native IBM compiler xlc
|
||||||
(vac.C 5.0.1) passes all regression tests. Other versions of OS and
|
(vac.C 5.0.1) passes all regression tests. Other versions of OS and
|
||||||
@ -113,6 +113,68 @@ libraries, the following URLs may help you...
|
|||||||
http://www.faqs.org/faqs/aix-faq/part4/section-22.html
|
http://www.faqs.org/faqs/aix-faq/part4/section-22.html
|
||||||
|
|
||||||
http://www.han.de/~jum/aix/ldd.c
|
http://www.han.de/~jum/aix/ldd.c
|
||||||
|
|
||||||
|
---
|
||||||
|
From: Christopher Browne <cbbrowne@ca.afilias.info>
|
||||||
|
Date: 2005-11-02
|
||||||
|
|
||||||
|
On AIX 5.3 ML3 (e.g. maintenance level 5300-03), there is some problem
|
||||||
|
with the handling of the pointer to memcpy. It is speculated that
|
||||||
|
this relates to some linker bug that may have been introduced between
|
||||||
|
5300-02 and 5300-03, but we have so far been unable to track down the
|
||||||
|
cause.
|
||||||
|
|
||||||
|
At any rate, the following patch, which "unwraps" the function
|
||||||
|
reference, has been observed to allow PG 8.1 pre-releases to pass
|
||||||
|
regression tests.
|
||||||
|
|
||||||
|
The same behaviour (albeit with varying underlying functions to
|
||||||
|
"blame") has been observed when compiling with either GCC 4.0 or IBM
|
||||||
|
XLC.
|
||||||
|
|
||||||
|
------------ per Seneca Cunningham -------------------
|
||||||
|
|
||||||
|
The following patch works on the AIX 5.3 ML3 box here and didn't cause
|
||||||
|
any problems with postgres on the x86 desktop. It's just a cleaner
|
||||||
|
version of what I tried earlier.
|
||||||
|
|
||||||
|
*** dynahash.c.orig Tue Nov 1 19:41:42 2005
|
||||||
|
--- dynahash.c Tue Nov 1 20:30:33 2005
|
||||||
|
***************
|
||||||
|
*** 670,676 ****
|
||||||
|
|
||||||
|
|
||||||
|
/* copy key into record */
|
||||||
|
currBucket->hashvalue = hashvalue;
|
||||||
|
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
|
||||||
|
|
||||||
|
|
||||||
|
/* caller is expected to fill the data field on return */
|
||||||
|
|
||||||
|
|
||||||
|
--- 670,687 ----
|
||||||
|
|
||||||
|
|
||||||
|
/* copy key into record */
|
||||||
|
currBucket->hashvalue = hashvalue;
|
||||||
|
! if (hashp->keycopy == memcpy)
|
||||||
|
! {
|
||||||
|
! memcpy(ELEMENTKEY(currBucket), keyPtr, keysize);
|
||||||
|
! }
|
||||||
|
! else if (hashp->keycopy == strncpy)
|
||||||
|
! {
|
||||||
|
! strncpy(ELEMENTKEY(currBucket), keyPtr, keysize);
|
||||||
|
! }
|
||||||
|
! else
|
||||||
|
! {
|
||||||
|
! hashp->keycopy(ELEMENTKEY(currBucket), keyPtr, keysize);
|
||||||
|
! }
|
||||||
|
|
||||||
|
|
||||||
|
/* caller is expected to fill the data field on return */
|
||||||
|
|
||||||
|
------------ per Seneca Cunningham -------------------
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
AIX, readline, and postgres 8.1.x:
|
AIX, readline, and postgres 8.1.x:
|
||||||
@ -185,3 +247,121 @@ References
|
|||||||
IBM Redbook
|
IBM Redbook
|
||||||
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
|
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
|
||||||
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open
|
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
AIX Memory Management: An Overview
|
||||||
|
==================================
|
||||||
|
|
||||||
|
by Seneca Cunningham...
|
||||||
|
|
||||||
|
AIX can be somewhat peculiar with regards to the way it does memory
|
||||||
|
management. You can have a server with many multiples of gigabytes of
|
||||||
|
RAM free, but still get out of memory or address space errors when
|
||||||
|
running applications.
|
||||||
|
|
||||||
|
Two examples of AIX-specific memory problems
|
||||||
|
--------------------------------------------
|
||||||
|
Both examples were from systems with gigabytes of free RAM.
|
||||||
|
|
||||||
|
a) createlang failing with unusual errors
|
||||||
|
Running as the owner of the postgres install:
|
||||||
|
-bash-3.00$ createlang plpgsql template1
|
||||||
|
createlang: language installation failed: ERROR: could not load library
|
||||||
|
"/opt/dbs/pgsql748/lib/plpgsql.so": A memory address is not in the
|
||||||
|
address space for the process.
|
||||||
|
|
||||||
|
Running as a non-owner in the group posessing the postgres install:
|
||||||
|
-bash-3.00$ createlang plpgsql template1
|
||||||
|
createlang: language installation failed: ERROR: could not load library
|
||||||
|
"/opt/dbs/pgsql748/lib/plpgsql.so": Bad address
|
||||||
|
|
||||||
|
b) out of memory errors in the postgres logs
|
||||||
|
Every memory allocation near or greater than 256MB failing.
|
||||||
|
|
||||||
|
|
||||||
|
The cause of these problems
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
The overall cause of all these problems is the default bittedness and
|
||||||
|
memory model used by the postmaster process.
|
||||||
|
|
||||||
|
By default, all binaries built on AIX are 32-bit. This does not
|
||||||
|
depend upon hardware type or kernel in use. These 32-bit processes
|
||||||
|
are limited to 4GB of memory laid out in 256MB segments using one of a
|
||||||
|
few models. The default allows for less than 256MB in the heap as it
|
||||||
|
shares a single segment with the stack.
|
||||||
|
|
||||||
|
In the case of example a), above, check your umask and the permissions
|
||||||
|
of the binaries in your postgres install. The binaries involved in
|
||||||
|
that example were 32-bit and installed as mode 750 instead of 755.
|
||||||
|
Due to the permissions being set in this fashion, only the owner or a
|
||||||
|
member of the possessing group can load the library. Since it isn't
|
||||||
|
world-readable, the loader places the object into the process' heap
|
||||||
|
instead of the shared library segments where it would otherwise be
|
||||||
|
placed.
|
||||||
|
|
||||||
|
Solutions and workarounds
|
||||||
|
-------------------------
|
||||||
|
In this section, all build flag syntax is presented for gcc.
|
||||||
|
|
||||||
|
The "ideal" solution for this is to use a 64-bit build of postgres,
|
||||||
|
but that's not always practical. Systems with 32-bit processors can
|
||||||
|
build, but not run, 64-bit binaries.
|
||||||
|
|
||||||
|
If a 32-bit binary is desired, set LDR_CNTRL to "MAXDATA=0xn0000000",
|
||||||
|
where 1 <= n <= 8, before starting the postmaster and try different
|
||||||
|
values and postgresql.conf settings to find a configuration that works
|
||||||
|
satisfactorily. This use of LDR_CNTRL tells AIX that you want the
|
||||||
|
postmaster to have $MAXDATA bytes set aside for the heap, allocated in
|
||||||
|
256MB segments.
|
||||||
|
|
||||||
|
When you find a workable configuration, ldedit can be used to modify
|
||||||
|
the binaries so that they default to using the desired heap size.
|
||||||
|
|
||||||
|
PostgreSQL might also be rebuilt, passing configure
|
||||||
|
LDFLAGS="-Wl,-bmaxdata:0xn0000000" to achieve the same effect.
|
||||||
|
|
||||||
|
For a 64-bit build, set OBJECT_MODE to 64 and pass CC="gcc -maix64"
|
||||||
|
and LDFLAGS="-Wl,-bbigtoc" to configure. If you omit the export of
|
||||||
|
OBJECT_MODE, your build may fail with linker errors. When OBJECT_MODE
|
||||||
|
is set, it tells AIX's build utilities such as ar, as, and ld what
|
||||||
|
type of objects to default to handling.
|
||||||
|
|
||||||
|
Overcommit
|
||||||
|
----------
|
||||||
|
|
||||||
|
By default, overcommit of paging space can happen. While I have not
|
||||||
|
seen this occur, AIX will kill processes when it runs out of memory
|
||||||
|
and the overcommit is accessed. The closest to this that I have seen
|
||||||
|
is fork failing because the system decided that there was not enough
|
||||||
|
memory for another process. Like many other parts of AIX, the paging
|
||||||
|
space allocation method and out-of-memory kill is configurable on a
|
||||||
|
system- or process-wide basis if this becomes a problem.
|
||||||
|
|
||||||
|
References and resources
|
||||||
|
------------------------
|
||||||
|
"Large Program Support"
|
||||||
|
AIX Documentation: General Programming Concepts: Writing and Debugging Programs
|
||||||
|
http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/lrg_prg_support.htm
|
||||||
|
|
||||||
|
"Program Address Space Overview"
|
||||||
|
AIX Documentation: General Programming Concepts: Writing and Debugging Programs
|
||||||
|
http://publib.boulder.ibm.com/infocenter/pseries/topic/com.ibm.aix.doc/aixprggd/genprogc/address_space.htm
|
||||||
|
|
||||||
|
"Performance Overview of the Virtual Memory Manager (VMM)"
|
||||||
|
AIX Documentation: Performance Management Guide
|
||||||
|
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/resmgmt2.htm
|
||||||
|
|
||||||
|
"Page Space Allocation"
|
||||||
|
AIX Documentation: Performance Management Guide
|
||||||
|
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf7.htm
|
||||||
|
|
||||||
|
"Paging-space thresholds tuning"
|
||||||
|
AIX Documentation: Performance Management Guide
|
||||||
|
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/topic/com.ibm.aix.doc/aixbman/prftungd/memperf6.htm
|
||||||
|
|
||||||
|
"Developing and Porting C and C++ Applications on AIX"
|
||||||
|
IBM Redbook
|
||||||
|
http://www.redbooks.ibm.com/redbooks/pdfs/sg245674.pdf
|
||||||
|
http://www.redbooks.ibm.com/abstracts/sg245674.html?Open
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
alink="#0000ff">
|
alink="#0000ff">
|
||||||
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
||||||
|
|
||||||
<P>Last updated: Sun Apr 2 23:40:12 EDT 2006</P>
|
<P>Last updated: Wed Apr 12 16:03:39 EDT 2006</P>
|
||||||
|
|
||||||
<P>Current maintainer: Bruce Momjian (<A href=
|
<P>Current maintainer: Bruce Momjian (<A href=
|
||||||
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)
|
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)
|
||||||
@ -38,7 +38,8 @@
|
|||||||
missing features?<BR>
|
missing features?<BR>
|
||||||
<A href="#item1.10">1.10</A>) What documentation is available?<BR>
|
<A href="#item1.10">1.10</A>) What documentation is available?<BR>
|
||||||
<A href="#item1.11">1.11</A>) How can I learn <SMALL>SQL</SMALL>?<BR>
|
<A href="#item1.11">1.11</A>) How can I learn <SMALL>SQL</SMALL>?<BR>
|
||||||
<A href="#item1.12">1.12</A>) How do I join the development team?<BR>
|
<A href="#item1.12">1.12</A>) How do I submit a patch or join the
|
||||||
|
development team?<BR>
|
||||||
<A href="#item1.13">1.13</A>) How does PostgreSQL compare to other
|
<A href="#item1.13">1.13</A>) How does PostgreSQL compare to other
|
||||||
<SMALL>DBMS</SMALL>s?<BR>
|
<SMALL>DBMS</SMALL>s?<BR>
|
||||||
|
|
||||||
@ -363,7 +364,7 @@
|
|||||||
and at <A href=
|
and at <A href=
|
||||||
"http://sqlcourse.com/">http://sqlcourse.com.</A></P>
|
"http://sqlcourse.com/">http://sqlcourse.com.</A></P>
|
||||||
|
|
||||||
<H3 id="item1.12">1.12) How do I join the development
|
<H3 id="item1.12">1.12) How do I submit a patch or join the development
|
||||||
team?</H3>
|
team?</H3>
|
||||||
|
|
||||||
<P>See the <a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html">
|
<P>See the <a href="http://www.postgresql.org/docs/faqs.FAQ_DEV.html">
|
||||||
@ -674,7 +675,8 @@ table?</TD><TD>unlimited</TD></TR>
|
|||||||
important.</P>
|
important.</P>
|
||||||
|
|
||||||
<P>The maximum table size, row size, and maximum number of columns
|
<P>The maximum table size, row size, and maximum number of columns
|
||||||
can be quadrupled by increasing the default block size to 32k.</P>
|
can be quadrupled by increasing the default block size to 32k. The
|
||||||
|
maximum table size can also be increased using table partitioning.</P>
|
||||||
|
|
||||||
<P>One limitation is that indexes can not be created on columns
|
<P>One limitation is that indexes can not be created on columns
|
||||||
longer than about 2,000 characters. Fortunately, such indexes are
|
longer than about 2,000 characters. Fortunately, such indexes are
|
||||||
|
Reference in New Issue
Block a user