2001-03-14 04:42:11 +08:00
|
|
|
============================================================
|
2002-11-12 04:04:05 +08:00
|
|
|
Frequently Asked Questions (FAQ) for PostgreSQL
|
2001-03-14 04:42:11 +08:00
|
|
|
Sun Solaris specific
|
|
|
|
to be read in conjunction with the installation instructions
|
|
|
|
============================================================
|
2006-10-05 06:03:22 +08:00
|
|
|
last updated: $Date: 2006/10/04 22:03:22 $
|
1999-09-27 11:34:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
Contents:
|
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
1) What tools do I need to build and install PostgreSQL on Solaris?
|
|
|
|
2) Why do I get problems when building with OpenSSL support?
|
2001-04-05 04:02:31 +08:00
|
|
|
3) Why does configure complain about a failed test program?
|
2003-10-10 01:11:13 +08:00
|
|
|
4) Why does my 64-bit build sometimes crash?
|
|
|
|
5) How can I compile for optimum performance?
|
2006-10-05 06:03:22 +08:00
|
|
|
6) How to compile PostgreSQL with Sun Studio?
|
|
|
|
7) Where I can download prepared Solaris packages?
|
|
|
|
8) How to tune PostgreSQL and Solaris for best performance?
|
|
|
|
9) Can I use dtrace for tracing PostgreSQL?
|
1999-09-28 00:44:56 +08:00
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
1) What tools do I need to build and install PostgreSQL on Solaris?
|
1999-09-27 11:34:54 +08:00
|
|
|
|
|
|
|
You will need
|
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
- GNU zip (for installing the documentation)
|
1999-09-27 11:34:54 +08:00
|
|
|
- GNU make
|
2001-03-14 04:42:11 +08:00
|
|
|
- GNU readline library (optional)
|
2006-10-05 06:03:22 +08:00
|
|
|
- Sun Studio CC or GCC
|
|
|
|
|
|
|
|
You can download Sun Studio from:
|
|
|
|
http://developers.sun.com/prodtech/cc/downloads/index.jsp
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2006-10-05 06:03:22 +08:00
|
|
|
Many of GNU tools are integrated into the Solaris 10 or they are
|
|
|
|
present on the Solaris companion CD.
|
|
|
|
|
|
|
|
If you like packages for older version of Solaris, you can find these
|
|
|
|
tools here:
|
|
|
|
http://www.sunfreeware.com or http://www.blastwave.org
|
1999-09-27 11:34:54 +08:00
|
|
|
|
|
|
|
If you prefer sources, look here:
|
|
|
|
http://www.gnu.org/order/ftp.html
|
|
|
|
|
2006-10-05 06:03:22 +08:00
|
|
|
You can build with either GCC or Sun's compiler suite. For better
|
|
|
|
code optimalization Sun's compiler is strongly recommended on the
|
|
|
|
SPARC architecture. We have heard reports of problems when using
|
|
|
|
gcc 2.95.1; gcc 2.95.3 or later is recommended. If you are using
|
|
|
|
Sun's compiler, be careful *not* to select /usr/ucb/cc;
|
|
|
|
use /opt/SUNWspro/bin/cc.
|
2002-02-13 06:35:07 +08:00
|
|
|
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
2) Why do I get problems when building with OpenSSL support?
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2001-04-09 00:36:13 +08:00
|
|
|
When you build PostgreSQL with OpenSSL support you might get
|
2001-03-14 04:42:11 +08:00
|
|
|
compilation errors in the following files:
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
src/backend/libpq/crypt.c
|
|
|
|
src/backend/libpq/password.c
|
|
|
|
src/interfaces/libpq/fe-auth.c
|
|
|
|
src/interfaces/libpq/fe-connect.c
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2001-03-14 04:42:11 +08:00
|
|
|
This is because of a namespace conflict between the standard
|
|
|
|
/usr/include/crypt.h header and the header files provided by OpenSSL.
|
1999-09-27 11:34:54 +08:00
|
|
|
|
2001-04-09 00:36:13 +08:00
|
|
|
Upgrading your OpenSSL installation to version 0.9.6a fixes this
|
|
|
|
problem.
|
2001-04-05 04:02:31 +08:00
|
|
|
|
2006-10-05 06:03:22 +08:00
|
|
|
Solaris 9 and above already newer version of OpenSSL.
|
|
|
|
|
2001-04-05 04:02:31 +08:00
|
|
|
|
|
|
|
3) Why does configure complain about a failed test program?
|
|
|
|
|
|
|
|
This is probably a case of the run-time linker being unable to find
|
2006-10-05 06:03:22 +08:00
|
|
|
some library. On solaris 8 and older it should be libz or some other
|
|
|
|
non-standard library, such as libssl. To point it to the right location,
|
|
|
|
set the LD_LIBRARY_PATH environment variable, e.g.,
|
2001-04-05 04:02:31 +08:00
|
|
|
|
2006-10-05 06:03:22 +08:00
|
|
|
LD_LIBRARY_PATH=/usr/sfw/lib:/opt/sfw/lib:/usr/local/lib
|
2001-04-05 04:02:31 +08:00
|
|
|
export LD_LIBRARY_PATH
|
|
|
|
|
|
|
|
and restart configure. You will also have to keep this setting
|
|
|
|
whenever you run any of the installed PostgreSQL programs.
|
|
|
|
|
2001-12-10 21:03:12 +08:00
|
|
|
Alternatively, set the environment variable LD_RUN_PATH. See the
|
|
|
|
ld(1) man page for more information.
|
2002-01-19 04:56:17 +08:00
|
|
|
|
|
|
|
|
2002-11-12 04:04:05 +08:00
|
|
|
4) Why does my 64-bit build sometimes crash?
|
2002-03-05 01:47:11 +08:00
|
|
|
|
|
|
|
On Solaris 7 and older, the 64-bit version of libc has a buggy vsnprintf
|
|
|
|
routine, which leads to erratic core dumps in PostgreSQL. The simplest known
|
|
|
|
workaround is to force PostgreSQL to use its own version of vsnprintf rather
|
2002-07-28 04:10:05 +08:00
|
|
|
than the library copy. To do this, after you run 'configure' edit a file
|
2002-03-05 01:47:11 +08:00
|
|
|
produced by configure:
|
|
|
|
|
2002-07-28 04:10:05 +08:00
|
|
|
In src/Makefile.global, change the line
|
|
|
|
LIBOBJS =
|
2002-03-05 01:47:11 +08:00
|
|
|
to read
|
2002-07-28 04:10:05 +08:00
|
|
|
LIBOBJS = snprintf.o
|
2002-03-05 01:47:11 +08:00
|
|
|
|
2002-07-28 04:10:05 +08:00
|
|
|
(There might be other files already listed in this variable. Order
|
|
|
|
does not matter.)
|
2002-03-05 01:47:11 +08:00
|
|
|
|
|
|
|
Then build as usual.
|
2006-10-05 06:03:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
5) How can I compile for optimum performance?
|
|
|
|
|
|
|
|
On SPARC architecture Sun Studio is strongly recommended for compilation.
|
|
|
|
Try using -xO5 optimalization flag to generate significantly faster binaries.
|
|
|
|
Do not use any flags which modify behavior of floating point operations and
|
|
|
|
errno processing (e.g. -fast). These flags should raise some nonstandard
|
|
|
|
PostgreSQL behavior for example in the date/time computing.
|
|
|
|
|
|
|
|
If you do not reason to use 64-bit binaries on SPARC, prefer 32-bit version.
|
|
|
|
The 64-bit operations are slower and 64-bit binaries are slower then 32-bits.
|
|
|
|
And on other side a 32-bit code on the AMD64 CPU family is not native and
|
|
|
|
that is why 32-bit code is significant slower on this CPU family.
|
|
|
|
|
|
|
|
|
|
|
|
6) How to compile PostgreSQL with Sun Studio?
|
|
|
|
|
|
|
|
On Solaris 10 you can performed following steps:
|
|
|
|
|
|
|
|
export CC=/opt/SUNWspro/bin/cc
|
|
|
|
export CFLAGS=-xO5
|
|
|
|
export LDFLAGS=-lm
|
|
|
|
./configure --without-readline
|
|
|
|
gmake
|
|
|
|
|
|
|
|
|
|
|
|
7) Where I can download prepared Solaris packages?
|
|
|
|
|
|
|
|
The PostgreSQL is bundled with Solaris 10 (from update 2). Official packages
|
|
|
|
are too available on http://pgfoundry.org/projects/solarispackages/.
|
|
|
|
|
|
|
|
Packages for older Solaris version (8,9) you can download from:
|
|
|
|
http://www.sunfreeware.com or http://www.blastwave.org
|
|
|
|
|
|
|
|
|
|
|
|
8) How to tune PostgreSQL and Solaris for best performance?
|
|
|
|
|
|
|
|
Some tuning tricks can be found here:
|
|
|
|
http://www.sun.com/servers/coolthreads/tnb/applications_postgresql.jsp
|
|
|
|
|
|
|
|
This article is primary focused on T2000 platform, however, many of
|
|
|
|
recommendations are general for other hardware with Solaris.
|
|
|
|
|
|
|
|
|
|
|
|
9) Can I use dtrace for tracing PostgreSQL?
|
|
|
|
|
|
|
|
The PostgreSQL 8.2 has implemented dtrace support. You can enable it by
|
|
|
|
the --enable-dtrace configure switch. If you want to compile a 64-bit code
|
|
|
|
with dtrace you must specify DTRACEFLAGS='-64', e.g.
|
|
|
|
|
|
|
|
Using gcc compiler:
|
|
|
|
$ ./configure CC='gcc -m64' --enable-dtrace DTRACEFLAGS='-64' ...
|
|
|
|
|
|
|
|
Using Sun compiler:
|
|
|
|
$ configure CC='/opt/SUNWspro/bin/cc -xtarget=native64' --enable-dtrace DTRACEFLAGS='-64'
|
|
|
|
|
|
|
|
|
|
|
|
If you have some problem with postgres linking, looks like:
|
|
|
|
|
|
|
|
Undefined first referenced
|
|
|
|
symbol in file
|
|
|
|
AbortTransaction utils/probes.o
|
|
|
|
CommitTransaction utils/probes.o
|
|
|
|
ld: fatal: Symbol referencing errors. No output written to postgres
|
|
|
|
collect2: ld returned 1 exit status
|
|
|
|
gmake: *** [postgres] Error 1
|
|
|
|
|
|
|
|
, check if you have Solaris 10u3 or newer installed on your box.
|
|
|
|
|
|
|
|
You can also find more information here:
|
|
|
|
http://blogs.sun.com/robertlor/entry/user_level_dtrace_probes_in
|
|
|
|
|
|
|
|
|