mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Update FAQ's for release.
This commit is contained in:
152
doc/FAQ_Linux
152
doc/FAQ_Linux
@ -1,3 +1,4 @@
|
||||
|
||||
=======================================================
|
||||
Frequently Asked Questions (FAQ) for PostgreSQL >= V6.1
|
||||
Linux Specific
|
||||
@ -46,7 +47,8 @@ Questions answered:
|
||||
fails with a message like:
|
||||
In file included from /usr/include/sys/sem.h:8,
|
||||
from ipc.c:37:
|
||||
/usr/include/asm/bitops.h:32: warning: no previous prototype for Set_bit'
|
||||
/usr/include/asm/bitops.h:32: warning: no previous prototype for Set_bi
|
||||
t'
|
||||
....
|
||||
make: *** [ipc.o] Error 1
|
||||
1.17) When compiling postgres, gcc reports signal 11 and aborts.
|
||||
@ -60,9 +62,9 @@ Questions answered:
|
||||
1.23) Why does the compile fail with messages about F_BOOLIN, F_BOOLOUT
|
||||
and F_BYTEAIN being undeclared?
|
||||
2.1) The linker fails to find libX11 when compiling pgtclsh
|
||||
3.1) I get an error reporting _fUnKy_POSTPORT_sTuFf_ undefined when
|
||||
3.1) I get an error reporting _fUnKy_POSTPORT_sTuFf_ undefined when
|
||||
running scripts like createuser
|
||||
3.2) I run postmaster and after that system says 'Bad system call(Core
|
||||
3.2) I run postmaster and after that system says 'Bad system call(Core
|
||||
dumped)'
|
||||
3.3) When I try to start the Postmaster, why do I get an error of the form
|
||||
Failed Assertion("!(file != 0):(null)", File:
|
||||
@ -93,15 +95,15 @@ Section 1: Compiling PostgreSQL
|
||||
1.1) What changes do I need to make to src/Makefile.global or
|
||||
src/Makefile.custom and are there any other changes needed?
|
||||
|
||||
Changes to the makefiles are most easily made by running the
|
||||
Changes to the makefiles are most easily made by running the
|
||||
customize shell script in the src directory which will write a
|
||||
Makefile.custom for you.
|
||||
Makefile.custom for you.
|
||||
|
||||
The only other change you may have to make is to replace
|
||||
The only other change you may have to make is to replace
|
||||
Flex if you have version 2.5.3 which has a bug which generally
|
||||
manifests itself as createuser failing (See Question 3.4)
|
||||
|
||||
If you modify the makefiles by hand, you *must* set the
|
||||
If you modify the makefiles by hand, you *must* set the
|
||||
following variable:
|
||||
PORTNAME= linux
|
||||
|
||||
@ -130,7 +132,7 @@ Section 1: Compiling PostgreSQL
|
||||
X11_INCDIR= /usr/include/X11
|
||||
X11_LIBDIR= /usr/X386/lib
|
||||
X11_LIB= -lX11
|
||||
|
||||
|
||||
You may also make any other changes you need as documented in
|
||||
the INSTALL file and in Makefile.global
|
||||
|
||||
@ -139,7 +141,7 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
Linux systems generally don't come with the GNU readline library
|
||||
installed. Either ensure you do not activate the readline options
|
||||
in src/Makefile.global or src/Makefile.custom or install the GNU
|
||||
in src/Makefile.global or src/Makefile.custom or install the GNU
|
||||
readline library.
|
||||
|
||||
Note that Debian Linux (like FreeBSD) does come with readline
|
||||
@ -159,7 +161,8 @@ Section 1: Compiling PostgreSQL
|
||||
RedHat now have a new ld.so RPM package on their FTP site.
|
||||
Simply grab:
|
||||
|
||||
ftp://ftp.redhat.com/pub/redhat/devel/i386/RedHat/RPMS/ld.so-1.7.14-4.i386.rpm
|
||||
ftp://ftp.redhat.com/pub/redhat/devel/i386/RedHat/RPMS/ld.so-1.
|
||||
7.14-4.i386.rpm
|
||||
|
||||
Install the RPM file in the usual way and off you go!
|
||||
|
||||
@ -168,17 +171,17 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
There has been one report of a corrupted system resulting from
|
||||
programs accessing these libraries while updating them (not
|
||||
altogether surprising). Consequently it is a good idea to reboot
|
||||
altogether surprising). Consequently it is a good idea to reboot
|
||||
the system before installing the new libraries and to
|
||||
have as little running as possible during this upgrade. Going
|
||||
into single-user mode is probably a good idea!
|
||||
|
||||
If you want to do it the hard way, you can obtain the library and the
|
||||
If you want to do it the hard way, you can obtain the library and the
|
||||
header file from:
|
||||
|
||||
|
||||
ftp://tsx-11.mit.edu/pub/linux/packages/GCC/ld.so-1.7.14.tar.gz
|
||||
|
||||
Alternatively, you may find precompiled binaries in
|
||||
Alternatively, you may find precompiled binaries in
|
||||
distributions/debian/buzz/binary-i386/base/ld.so-1.7.14-4.deb
|
||||
on the same site, or follow the instructions given for question 1.2 for
|
||||
correcting the same error with early releases of Slackware 3.1.
|
||||
@ -192,15 +195,15 @@ Section 1: Compiling PostgreSQL
|
||||
such as dlopen(), dlclose(), etc. during the last phase of the
|
||||
compilation.
|
||||
|
||||
See the answer to question 1.3. Slackware up to version 3.0 was
|
||||
See the answer to question 1.3. Slackware up to version 3.0 was
|
||||
supplied with this library and include file and they seem to be
|
||||
back in again in the latest versions of 3.1, but the early 3.1
|
||||
releases (before 9th September 1996) had them missing and many
|
||||
releases (before 9th September 1996) had them missing and many
|
||||
CD-ROM versions will have been pressed from the first 3.1 releases.
|
||||
|
||||
There has been one report of a corrupted system resulting from
|
||||
programs accessing these libraries while updating them (not
|
||||
altogether surprising). Consequently it is a good idea to reboot
|
||||
altogether surprising). Consequently it is a good idea to reboot
|
||||
the system before installing the new libraries and to
|
||||
have as little running as possible during this upgrade. Going
|
||||
into single-user mode is probably a good idea!
|
||||
@ -242,7 +245,7 @@ Section 1: Compiling PostgreSQL
|
||||
after installing the library and before recompiling.
|
||||
|
||||
|
||||
1.5) My compile of the backend dies complaining about the include file
|
||||
1.5) My compile of the backend dies complaining about the include file
|
||||
dlfcn.h missing
|
||||
|
||||
See the answer to question 1.3/1.4. Don't forget that if you are using
|
||||
@ -254,15 +257,15 @@ Section 1: Compiling PostgreSQL
|
||||
1.6) GCC complains about an ignored option -fpic
|
||||
|
||||
Earlier versions of GCC accepted either -fpic or -fPIC.
|
||||
It appears that more recent versions (V2.7.2?) require -fPIC.
|
||||
If you are using an ELF version of Linux, this can safely be
|
||||
It appears that more recent versions (V2.7.2?) require -fPIC.
|
||||
If you are using an ELF version of Linux, this can safely be
|
||||
ignored as -fPIC is the default.
|
||||
|
||||
You can correct this by editing src/Makefile.global and
|
||||
You can correct this by editing src/Makefile.global and
|
||||
changing CFLAGS_SL
|
||||
|
||||
|
||||
1.7) I get warnings of the form
|
||||
1.7) I get warnings of the form
|
||||
warning: cast from pointer to integer of different size
|
||||
|
||||
These were seen in earlier versions of Postgres95 and could
|
||||
@ -273,12 +276,12 @@ Section 1: Compiling PostgreSQL
|
||||
1.8) [SuSE-Linux 4.2-4.4] Where is curses and termcap?
|
||||
|
||||
SuSE-Linux 4.2 has ncurses but not curses. 4.4 appears to have both.
|
||||
SuSE-Linux also has the termcap library is in /usr/lib/termcap
|
||||
SuSE-Linux also has the termcap library is in /usr/lib/termcap
|
||||
instead of in /usr/lib.
|
||||
|
||||
PostgreSQL (up to V6.0)
|
||||
-----------------------
|
||||
Set the value of CURSES_LIB in src/Makefile.custom to -lncurses
|
||||
Set the value of CURSES_LIB in src/Makefile.custom to -lncurses
|
||||
(or do this through the customize script).
|
||||
Add the following line to src/Makefile.custom:
|
||||
|
||||
@ -301,11 +304,11 @@ Section 1: Compiling PostgreSQL
|
||||
If this doesn't work (I don't have SuSE to verify that it does)
|
||||
then after running configure, you need to edit
|
||||
src/Makefile.global and add -ltermcap to the LDFLAGS line
|
||||
(after -lreadline). (Alternatively, you can modify
|
||||
(after -lreadline). (Alternatively, you can modify
|
||||
src/Makefile.custom before running configure.)
|
||||
|
||||
Some versions of SuSE provide only ncurses, so you may need
|
||||
to force use of ncurses rather than curses by changing
|
||||
to force use of ncurses rather than curses by changing
|
||||
-lcurses to -lncurses. (Reported true for SuSE 5.1)
|
||||
|
||||
|
||||
@ -347,7 +350,7 @@ Section 1: Compiling PostgreSQL
|
||||
for PostgreSQL is to use bison -y rather than yacc.
|
||||
|
||||
yacc is generally implemented as a script which invokes bison -y
|
||||
For some reason (certain versions of make? certain versions of
|
||||
For some reason (certain versions of make? certain versions of
|
||||
bash?) make is unable to execute this script file.
|
||||
|
||||
To correct this, simply edit src/mk/port/postgres.mk.linux
|
||||
@ -359,14 +362,14 @@ Section 1: Compiling PostgreSQL
|
||||
1.13) What are the references in X11_LIB to libsocket and libnsl in
|
||||
src/Makefile.global?
|
||||
|
||||
This was a problem in 1.08 (they are Sun Solaris specific).
|
||||
This was a problem in 1.08 (they are Sun Solaris specific).
|
||||
It is fixed in 1.09 and 6.0
|
||||
|
||||
1.14) [DEBIAN] Where is libtermcap?
|
||||
|
||||
Debian Linux comes without the termcap library and uses ncurses
|
||||
(which uses terminfo instead). There is no need to change the
|
||||
CURSES_LIB variable in src/bin/psql/Makefile since Debian provides
|
||||
(which uses terminfo instead). There is no need to change the
|
||||
CURSES_LIB variable in src/bin/psql/Makefile since Debian provides
|
||||
a link from libncurses to libcurses (unlike SuSE-Linux --- see
|
||||
Question 1.8).
|
||||
|
||||
@ -381,9 +384,9 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
1.15) [REDHAT] Can I get PostgreSQL as an RPM?
|
||||
|
||||
Yes! Michal Mosiewicz <mimo@lodz.pdi.net>
|
||||
Yes! Michal Mosiewicz
|
||||
(http://www.pdi.lodz.pl/~mimo) has kindly put together an RPM
|
||||
for PostgreSQL V6.0 on Intel architectures which he has uploaded to
|
||||
for PostgreSQL V6.0 on Intel architectures which he has uploaded to
|
||||
ftp://ftp.redhat.org/pub/Incoming/Postgres-6.0-1.i386.rpm
|
||||
|
||||
This is a pre-compiled version, the source RPM is on its
|
||||
@ -393,12 +396,13 @@ Section 1: Compiling PostgreSQL
|
||||
fails with a message like:
|
||||
In file included from /usr/include/sys/sem.h:8,
|
||||
from ipc.c:37:
|
||||
/usr/include/asm/bitops.h:32: warning: no previous prototype for Set_bit'
|
||||
/usr/include/asm/bitops.h:32: warning: no previous prototype for Set_bi
|
||||
t'
|
||||
....
|
||||
make: *** [ipc.o] Error 1
|
||||
|
||||
The problem is that Linux provides no prototypes for these
|
||||
inline functions. The solution is to go into the
|
||||
inline functions. The solution is to go into the
|
||||
.../src/backend/storage/ipc directory and edit the Makefile.
|
||||
Change the line
|
||||
CFLAGS+=$(INCLUDE_OPT)
|
||||
@ -409,12 +413,12 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
1.17) When compiling postgres, gcc reports signal 11 and aborts.
|
||||
More specifically:
|
||||
gcc: Internal compiler error: program cc1 got fatal
|
||||
gcc: Internal compiler error: program cc1 got fatal
|
||||
signal 11
|
||||
|
||||
This may be a hardware/memory problem. PortgreSQL is a big
|
||||
program, and large gcc compilations (such as building
|
||||
PostgreSQL or bebuilding the kernel) stress memory like
|
||||
PostgreSQL or bebuilding the kernel) stress memory like
|
||||
few other programs, resulting in errors that do not occur
|
||||
in normal operation. Lesser operating systems are also
|
||||
unlikely to stress the hardware to this degree so you
|
||||
@ -429,7 +433,7 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
1.18) Can I install 6.1.1 under MkLinux?
|
||||
|
||||
Tatsuo Ishii <t-ishii@sra.co.jp> has done this under
|
||||
Tatsuo Ishii has done this under
|
||||
MkLinux DR2.1 update2 after a small patch available from:
|
||||
ftp://ftp.sra.co.jp/pub/cmd/postgres/6.1.1/mklinux.patch.gz
|
||||
|
||||
@ -437,9 +441,9 @@ Section 1: Compiling PostgreSQL
|
||||
|
||||
There have been a couple of reports of gmake either just
|
||||
exiting early or seg faulting. The latter problem was reported
|
||||
with gmake 3.74 - upgrading to 3.76.1 solved the problem.
|
||||
with gmake 3.74 - upgrading to 3.76.1 solved the problem.
|
||||
However, 3.74 is known to work fine in other people's setups.
|
||||
In short, try upgrading gmake to the latest version you can
|
||||
In short, try upgrading gmake to the latest version you can
|
||||
find before reporting this as a problem
|
||||
|
||||
1.20) How can I optimise for 486 or pentium processors
|
||||
@ -462,16 +466,16 @@ Section 1: Compiling PostgreSQL
|
||||
instead of '5 hours'
|
||||
|
||||
This is a problem with the glibc2 library which comes with
|
||||
Redhat 5.0. Update your glibc to the latest RedHat version
|
||||
for v5.0/hurricane. Anything prior to glibc-2.0.7 is likely
|
||||
Redhat 5.0. Update your glibc to the latest RedHat version
|
||||
for v5.0/hurricane. Anything prior to glibc-2.0.7 is likely
|
||||
to have the problem.
|
||||
|
||||
|
||||
1.22) Why don't I get any shared libraries for libpq when I compile
|
||||
6.3.2?
|
||||
|
||||
There was some last minute breakage of the Linux configuration for
|
||||
v6.3.2. Look in ftp://postgresql.org/pub/patches/ for a few fix-ups,
|
||||
including a linux_elf patch.
|
||||
including a linux_elf patch.
|
||||
|
||||
1.23) Why does the compile fail with messages about F_BOOLIN, F_BOOLOUT
|
||||
and F_BYTEAIN being undeclared?
|
||||
@ -490,11 +494,11 @@ Section 1: Compiling PostgreSQL
|
||||
bootstrap.c:161: initializer element for `Procid[1].inproc' is not
|
||||
constant
|
||||
|
||||
This is tricky unless you know why it happens, as these constants
|
||||
This is tricky unless you know why it happens, as these constants
|
||||
don't seem to be defined anywhere.
|
||||
|
||||
The solution is to make sure that cpp is included in your path
|
||||
before you start the make.
|
||||
The solution is to make sure that cpp is included in your path
|
||||
before you start the make.
|
||||
|
||||
On Redhat 5.1, cpp is in /usr/lib/gcc-lib/i386-redhat-linux/2.7.2.3
|
||||
|
||||
@ -514,28 +518,28 @@ Section 2: Compiling accessory programs
|
||||
Section 3: Runtime Problems
|
||||
----------------------------------------------------------------------
|
||||
|
||||
3.1) I get an error reporting _fUnKy_POSTPORT_sTuFf_ undefined when
|
||||
3.1) I get an error reporting _fUnKy_POSTPORT_sTuFf_ undefined when
|
||||
running scripts like createuser
|
||||
|
||||
This is a bug in V1.06-V1.07 of Postgres and is fixed in V1.08
|
||||
and above.
|
||||
|
||||
3.2) I run postmaster and after that system says 'Bad system call(Core
|
||||
3.2) I run postmaster and after that system says 'Bad system call(Core
|
||||
dumped)'
|
||||
|
||||
This indicates that you have not compiled shared memory support
|
||||
into your kernel. You need to recompile the Linux kernel to add this
|
||||
This indicates that you have not compiled shared memory support
|
||||
into your kernel. You need to recompile the Linux kernel to add this
|
||||
feature.
|
||||
|
||||
|
||||
3.3) When I try to start the Postmaster, why do I get an error of the form
|
||||
Failed Assertion("!(file != 0):(null)", File:
|
||||
Failed Assertion("!(file != 0):(null)", File:
|
||||
"/usr/local/PostgreSQL/src/backend/storage/file/fd.c", Line: 257)
|
||||
!(file != 0) (0)
|
||||
initdb: could not create template database
|
||||
initdb: cleaning up.
|
||||
|
||||
Your permissions on the file /dev/null are wrong.
|
||||
Your permissions on the file /dev/null are wrong.
|
||||
|
||||
ls -l /dev/null should give you something like:
|
||||
|
||||
@ -547,7 +551,7 @@ Section 3: Runtime Problems
|
||||
|
||||
3.4) Why doesn't createuser work?
|
||||
|
||||
There is a problem with Version 2.5.3 of GNU flex and createuser.
|
||||
There is a problem with Version 2.5.3 of GNU flex and createuser.
|
||||
Your options are to downgrade flex to V2.5.2, upgrade to V2.5.4
|
||||
or apply a patch to V2.5.3 which is supplied in doc/README.flex
|
||||
You may obtain V2.5.4 from
|
||||
@ -564,21 +568,21 @@ Section 3: Runtime Problems
|
||||
3.6) Why does psql fail with:
|
||||
psql: can't load library 'libpq.so.1'
|
||||
|
||||
Psql has been compiled to link dynamically with the libpq
|
||||
library.
|
||||
Psql has been compiled to link dynamically with the libpq
|
||||
library.
|
||||
|
||||
To solve this, you should log in as root and edit the file
|
||||
/etc/ld.so.conf
|
||||
Add a single line at the end which gives the name of the
|
||||
PostgreSQL library directory (the lib subdirectory of your
|
||||
PostgreSQL installation) and run
|
||||
/sbin/ldconfig -v
|
||||
To solve this, you should log in as root and edit the file
|
||||
/etc/ld.so.conf
|
||||
Add a single line at the end which gives the name of the
|
||||
PostgreSQL library directory (the lib subdirectory of your
|
||||
PostgreSQL installation) and run
|
||||
/sbin/ldconfig -v
|
||||
|
||||
Alternatively, (and if you don't have root access), you may
|
||||
use the LD_LIBRARY_PATH environment variable.
|
||||
|
||||
The LD_LIBRARY_PATH variable contains a colon separated list of
|
||||
paths to be searched for shared libraries. This list is
|
||||
paths to be searched for shared libraries. This list is
|
||||
searched before the libraries specified by ldconfig.
|
||||
|
||||
Therefore under Bash, you would do something like:
|
||||
@ -595,13 +599,13 @@ Section 3: Runtime Problems
|
||||
|
||||
3.7) Other strange behaviour
|
||||
|
||||
I'm not sure what the symptoms might be except for nothing
|
||||
I'm not sure what the symptoms might be except for nothing
|
||||
working properly, but it has been pointed out that one needs
|
||||
to be careful that the dynamic loader loads the correct version
|
||||
of the libpq library. If you have old versions lying around
|
||||
in your library path (for example in /usr/lib) these may get
|
||||
loaded instead of the new version you intended to load. Make
|
||||
sure you get them out of the way and look at Q3.6 for
|
||||
sure you get them out of the way and look at Q3.6 for
|
||||
details of loading libraries.
|
||||
|
||||
3.8) When PostgreSQL is running when the system is shutdown, Linux
|
||||
@ -614,13 +618,13 @@ Section 3: Runtime Problems
|
||||
You are therefore recommended to start the postmaster from an
|
||||
rc script. Under a Slackware-like release, you would modify
|
||||
/etc/rc.d/rc.local to start the postmaster. Under a RedHat-like
|
||||
release you should create a SysV style script in
|
||||
release you should create a SysV style script in
|
||||
/etc/rc.d/rc3.d based on the /etc/rc.d/init.d skeleton file.
|
||||
|
||||
There's a sample file in contrib/linux/postgres.init
|
||||
|
||||
Here's another sample file supplied by John Robinson
|
||||
<john@intelligent.co.uk> which you should modify as needed:
|
||||
Here's another sample file supplied by John Robinson
|
||||
which you should modify as needed:
|
||||
|
||||
#!/bin/sh
|
||||
#
|
||||
@ -644,7 +648,8 @@ case "$1" in
|
||||
echo -n "Starting postgres Postmaster daemon:"
|
||||
if [ -z "`pidofproc postmaster`" ]
|
||||
then
|
||||
su postgres -c "/usr/local/pgsql/bin/postmaster -D /home/postgreSQL/data -p 5432 &"
|
||||
su postgres -c "/usr/local/pgsql/bin/postmaster -D /home/postgr
|
||||
eSQL/data -p 5432 &"
|
||||
echo -n " postmaster"
|
||||
else
|
||||
echo -n " (already running)"
|
||||
@ -673,7 +678,7 @@ exit 0
|
||||
|
||||
This is due to a bug in regression scripts which only happens
|
||||
on linux boxes. There are two workarounds as far as I know
|
||||
(information from Tatsuo Ishii <t-ishii@sra.co.jp>):
|
||||
(information from Tatsuo Ishii ):
|
||||
|
||||
1. change following in regress.sh:
|
||||
time postgres -texecutor -tplanner -Q bench < bench.sql
|
||||
@ -682,7 +687,8 @@ exit 0
|
||||
|
||||
2. after running the test, remove a line at the very end of
|
||||
bench.out something like:
|
||||
85.86user 114.47system 4:49.20elapsed 69%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
85.86user 114.47system 4:49.20elapsed 69%CPU (0avgtext+0avgdata
|
||||
0maxresident)k
|
||||
then type:
|
||||
sh ./perquery < bench.out > & bench.out.perquery
|
||||
|
||||
@ -693,8 +699,10 @@ exit 0
|
||||
select '4 hours'::timespan;
|
||||
returning '3 hours 59 minutes 60 seconds'?
|
||||
|
||||
You are running the new glibc2 libraries and have a version earlier than
|
||||
2.0.7. It is a math rounding problem in the library. Upgrade your library.
|
||||
You are running the new glibc2 libraries and have a version earlier tha
|
||||
n
|
||||
2.0.7. It is a math rounding problem in the library. Upgrade your libra
|
||||
ry.
|
||||
----------------------------------------------------------------------------
|
||||
Dr. Andrew C.R. Martin University College London
|
||||
EMAIL: (Work) martin@biochem.ucl.ac.uk (Home) andrew@stagleys.demon.co.uk
|
||||
|
Reference in New Issue
Block a user