11============================================================
22Frequently Asked Questions (FAQ) for PostgreSQL
33Sun Solaris specific
4- to be read in conjunction with the installation instructions
4+ To be read in conjunction with the installation instructions.
55============================================================
6- last updated: $Date: 2006/10/04 22: 03:22 $
6+ Last updated: $Date: 2006/10/05 03:13:15 $
77
88
99Contents:
@@ -22,10 +22,10 @@ Contents:
2222
2323You will need
2424
25- - GNU zip (for installing the documentation)
26- - GNU make
27- - GNU readline library (optional)
28- - Sun Studio CC or GCC
25+ GNU zip (for installing the documentation)
26+ GNU make
27+ GNU readline library (optional)
28+ Sun Studio CC or GCC
2929
3030You can download Sun Studio from:
3131http://developers.sun.com/prodtech/cc/downloads/index.jsp
@@ -35,66 +35,67 @@ present on the Solaris companion CD.
3535
3636If you like packages for older version of Solaris, you can find these
3737tools here:
38- http://www.sunfreeware.com or http://www.blastwave.org
38+
39+ http://www.sunfreeware.com or http://www.blastwave.org
3940
4041If you prefer sources, look here:
41- http://www.gnu.org/order/ftp.html
4242
43- You can build with either GCC or Sun's compiler suite. For better
44- code optimalization Sun's compiler is strongly recommended on the
45- SPARC architecture. We have heard reports of problems when using
46- gcc 2.95.1; gcc 2.95.3 or later is recommended. If you are using
47- Sun's compiler, be careful *not* to select /usr/ucb/cc;
48- use /opt/SUNWspro/bin/cc.
43+ http://www.gnu.org/order/ftp.html
44+
45+ You can build with either GCC or Sun's compiler suite. For better code
46+ optimalization Sun's compiler is strongly recommended on the SPARC
47+ architecture. We have heard reports of problems when using gcc 2.95.1;
48+ gcc 2.95.3 or later is recommended. If you are using Sun's compiler, be
49+ careful *not* to select /usr/ucb/cc; use /opt/SUNWspro/bin/cc.
4950
5051
51522) Why do I get problems when building with OpenSSL support?
5253
53- When you build PostgreSQL with OpenSSL support you might get
54- compilation errors in the following files:
54+ When you build PostgreSQL with OpenSSL support you might get compilation
55+ errors in the following files:
5556
56- src/backend/libpq/crypt.c
57- src/backend/libpq/password.c
58- src/interfaces/libpq/fe-auth.c
59- src/interfaces/libpq/fe-connect.c
57+ src/backend/libpq/crypt.c
58+ src/backend/libpq/password.c
59+ src/interfaces/libpq/fe-auth.c
60+ src/interfaces/libpq/fe-connect.c
6061
6162This is because of a namespace conflict between the standard
6263/usr/include/crypt.h header and the header files provided by OpenSSL.
6364
6465Upgrading your OpenSSL installation to version 0.9.6a fixes this
65- problem.
66-
67- Solaris 9 and above already newer version of OpenSSL.
66+ problem. Solaris 9 and above already newer version of OpenSSL.
6867
6968
70693) Why does configure complain about a failed test program?
7170
72- This is probably a case of the run-time linker being unable to find
73- some library. On solaris 8 and older it should be libz or some other
74- non-standard library, such as libssl. To point it to the right location,
75- set the LD_LIBRARY_PATH environment variable, e.g.,
76-
77- LD_LIBRARY_PATH=/usr/sfw/lib:/opt/sfw/lib:/usr/local/lib
78- export LD_LIBRARY_PATH
71+ This is probably a case of the run-time linker being unable to find some
72+ library. On solaris 8 and older it should be libz or some other
73+ non-standard library, such as libssl. To point it to the right
74+ location, set the LD_LIBRARY_PATH environment variable, e.g.,
7975
80- and restart configure. You will also have to keep this setting
81- whenever you run any of the installed PostgreSQL programs.
76+ LD_LIBRARY_PATH=/usr/sfw/lib:/opt/sfw/lib:/usr/local/lib
77+ export LD_LIBRARY_PATH
8278
83- Alternatively, set the environment variable LD_RUN_PATH. See the
84- ld(1) man page for more information.
79+ and restart configure. You will also have to keep this setting whenever
80+ you run any of the installed PostgreSQL programs. Alternatively, set
81+ the environment variable LD_RUN_PATH. See the ld(1) man page for more
82+ information.
8583
8684
87854) Why does my 64-bit build sometimes crash?
8886
8987On Solaris 7 and older, the 64-bit version of libc has a buggy vsnprintf
90- routine, which leads to erratic core dumps in PostgreSQL. The simplest known
91- workaround is to force PostgreSQL to use its own version of vsnprintf rather
92- than the library copy. To do this, after you run 'configure' edit a file
93- produced by configure:
88+ routine, which leads to erratic core dumps in PostgreSQL. The simplest
89+ known workaround is to force PostgreSQL to use its own version of
90+ vsnprintf rather than the library copy. To do this, after you run
91+ 'configure' edit a file produced by configure:
9492
9593In src/Makefile.global, change the line
94+
9695 LIBOBJS =
96+
9797to read
98+
9899 LIBOBJS = snprintf.o
99100
100101(There might be other files already listed in this variable. Order
@@ -105,42 +106,45 @@ Then build as usual.
105106
1061075) How can I compile for optimum performance?
107108
108- On SPARC architecture Sun Studio is strongly recommended for compilation.
109- Try using -xO5 optimalization flag to generate significantly faster binaries.
110- Do not use any flags which modify behavior of floating point operations and
111- errno processing (e.g. -fast). These flags should raise some nonstandard
112- PostgreSQL behavior for example in the date/time computing.
109+ On SPARC architecture Sun Studio is strongly recommended for
110+ compilation. Try using -xO5 optimalization flag to generate
111+ significantly faster binaries. Do not use any flags which modify
112+ behavior of floating point operations and errno processing (e.g.
113+ -fast). These flags should raise some nonstandard PostgreSQL behavior
114+ for example in the date/time computing.
113115
114- If you do not reason to use 64-bit binaries on SPARC, prefer 32-bit version.
115- The 64-bit operations are slower and 64-bit binaries are slower then 32-bits.
116- And on other side a 32-bit code on the AMD64 CPU family is not native and
117- that is why 32-bit code is significant slower on this CPU family.
116+ If you do not reason to use 64-bit binaries on SPARC, prefer 32-bit
117+ version. The 64-bit operations are slower and 64-bit binaries are slower
118+ then 32-bits. And on other side a 32-bit code on the AMD64 CPU family is
119+ not native and that is why 32-bit code is significant slower on this
120+ CPU family.
118121
119122
1201236) How to compile PostgreSQL with Sun Studio?
121124
122125On Solaris 10 you can performed following steps:
123126
124- export CC=/opt/SUNWspro/bin/cc
125- export CFLAGS=-xO5
126- export LDFLAGS=-lm
127- ./configure --without-readline
128- gmake
127+ export CC=/opt/SUNWspro/bin/cc
128+ export CFLAGS=-xO5
129+ export LDFLAGS=-lm
130+ ./configure --without-readline
131+ gmake
129132
130133
1311347) Where I can download prepared Solaris packages?
132135
133- The PostgreSQL is bundled with Solaris 10 (from update 2). Official packages
134- are too available on http://pgfoundry.org/projects/solarispackages/.
135-
136- Packages for older Solaris version (8,9) you can download from:
137- http://www.sunfreeware.com or http://www.blastwave.org
136+ The PostgreSQL is bundled with Solaris 10 (from update 2). Official
137+ packages are too available on
138+ http://pgfoundry.org/projects/solarispackages/. Packages for older
139+ Solaris version (8,9) you can download from: http://www.sunfreeware.com
140+ or http://www.blastwave.org
138141
139142
1401438) How to tune PostgreSQL and Solaris for best performance?
141144
142145Some tuning tricks can be found here:
143- http://www.sun.com/servers/coolthreads/tnb/applications_postgresql.jsp
146+
147+ http://www.sun.com/servers/coolthreads/tnb/applications_postgresql.jsp
144148
145149This article is primary focused on T2000 platform, however, many of
146150recommendations are general for other hardware with Solaris.
@@ -149,29 +153,31 @@ recommendations are general for other hardware with Solaris.
1491539) Can I use dtrace for tracing PostgreSQL?
150154
151155The PostgreSQL 8.2 has implemented dtrace support. You can enable it by
152- the --enable-dtrace configure switch. If you want to compile a 64-bit code
153- with dtrace you must specify DTRACEFLAGS='-64', e.g.
156+ the --enable-dtrace configure switch. If you want to compile a 64-bit
157+ code with dtrace you must specify DTRACEFLAGS='-64', e.g.
154158
155159Using gcc compiler:
156- $ ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
160+
161+ $ ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
157162
158163Using Sun compiler:
159- $ configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64'
160164
165+ $ configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64'
161166
162- If you have some problem with postgres linking, looks like:
163-
164- Undefined first referenced
165- symbol in file
166- AbortTransaction utils/probes.o
167- CommitTransaction utils/probes.o
168- ld: fatal: Symbol referencing errors. No output written to postgres
169- collect2: ld returned 1 exit status
170- gmake: *** [postgres] Error 1
171167
172- , check if you haveSolaris 10u3 or newer installed on your box.
168+ If you havesome problem with postgres linking, looks like:
173169
174- You can also find more information here:
175- http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in
170+ Undefined first referenced
171+ symbol in file
172+ AbortTransaction utils/probes.o
173+ CommitTransaction utils/probes.o
174+ ld: fatal: Symbol referencing errors. No output written to postgres
175+ collect2: ld returned 1 exit status
176+ gmake: *** [postgres] Error 1
177+
178+ check if you have Solaris 10u3 or newer installed on your box. You can
179+ also find more information here:
180+
181+ http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in
176182
177183