When installing postgreSQL, you may encounter a problem when executing configure
The following error is reported: configure: error: readline library not found, but I installed it in the system.
Readline package,
1. Environment Information
2. According to the prompt, I tested the configre command and reported this error.
[Root @ HK81-107 postgresql-9.0.0] #./configure
Checking build system type... i686-pc-linux-gnu
Checking host system type... i686-pc-linux-gnu
Checking which template to use... linux
Checking whether to build with 64-bit integer date/time support... yes
Checking whether NLS is wanted... no
Checking for default port number... 5432
Checking for block size... 8kB
Checking for segment size... 1 GB
Checking for WAL block size... 8kB
Checking for WAL segment size... 16 MB
Checking for gcc... gcc
Checking for C compiler default output file name... a. out
Checking whether the C compiler works... yes
Checking whether we are cross compiling... no
Checking for Suffix of executables...
Checking for Suffix of object files... o
Checking whether we are using the gnu c compiler... yes
Checking whether GCC accepts-G... yes
Checking for GCC option to accept ISO c89... None needed
Checking if GCC supports-wdeclaration-after-statement... yes
Checking if GCC supports-wendif-labels... yes
Checking if GCC supports-fno-strict-aliasing... yes
Checking if GCC supports-fwrapv... yes
Checking whether the C compiler still works... yes
Checking how to run the C Preprocessor... gcc-e
Checking allow thread-safe client libraries... yes
Checking whether to build with TCL... no
Checking whether to build Perl modules... no
Checking whether to build Python modules... no
Checking whether to build with gssapi support... no
Checking whether to build with Kerberos 5 support... no
Checking whether to build with Pam support... no
Checking whether to build with LDAP support... no
Checking whether to build with bonjour support... no
Checking whether to build with OpenSSL support... no
Checking for grep that handles long lines and-e.../bin/grep
Checking for egrep.../bin/grep-e
Checking for LD used by GCC.../usr/bin/LD
Checking if the linker (/usr/bin/LD) is GNU lD... yes
Checking for ranlib... ranlib
Checking for strip... strip
Checking whether it is possible to strip libraries... yes
Checking for Ar... Ar
Checking for tar.../bin/tar
Checking whether ln-s works... yes
Checking for gawk... gawk
Checking for a thread-safe mkdir-p.../bin/mkdir-P
Checking for bison... no
Configure: Warning:
* ** Without bison you will not be able to build PostgreSQL from CVS nor
* ** Change any of the parser definition files. You can obtain bison from
* ** A GNU mirror site. (If you are using the official distribution
* ** PostgreSQL then you do not need to worry about this, because the bison
* ** Output is pre-generated .)
Checking for flex... no
Configure: Warning:
* ** Without flex you will not be able to build PostgreSQL from CVS nor
* ** Change any of the specified definition files. You can obtain flex from
* ** A GNU mirror site. (If you are using the official distribution
* ** PostgreSQL then you do not need to worry about this because the Flex
* ** Output is pre-generated .)
Checking for perl.../usr/bin/perl
Configure: using perl 5.8.8
Checking for main in-lm... yes
Checking for library containing setproctitle... no
Checking for library containing dlopen...-ldl
Checking for library containing socket... none required
Checking for library containing shl_load... no
Checking for library containing getopt_long... none required
Checking for library containing crypt...-lcrypt
Checking for library containing fdatasync... none required
Checking for library containing gethostbyname_r... none required
Checking for library containing shmget... none required
Checking for-lreadline... no
Checking for-ledit... no
Configure: error: readline library not found
If you have readline already installed, see config. log for details on
Failure. It is possible the compiler isnt looking in the proper directory.
Use -- without-Readline to disable Readline support.
As prompted, The readline package should not be installed.
3. Check whether the Readline package is installed.
[Root @ HK81-107] # rpm-qa | grep readline
Readline-5.1-3.el5
The readline package has been installed.
4Search for related Readline packages using yum
[Root @ HK81-107] # yum search readline
Lftp. i386: A sophisticated file transfer program
Lftp. i386: A sophisticated file transfer program
Php-readline.i386: Standard PHP module provides readline library support
Lftp. i386: A sophisticated file transfer program
Readline. i386: A library for editing typed command lines.
Compat-readline43.i386: The readline 4.3 library for compatibility with older software.
Readline-devel.i386: files needed to develop programs which use the Readline library.
Readline. i386: A library for editing typed command lines.
According to the prompt, there is a package that attracts attention "readline-devel". It may be related to this package.
5. Install the Readline-devel package
[Root @ HK81-107] # yum-y install-y readline-devel
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.i386 0: 5. 1-3.el5 set to be updated
--> Processing Dependency: libtermcap-devel for package: readline-devel
--> Running transaction check
---> Package libtermcap-devel.i386. 0.8-46.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
========================================================== ============================================
Package Arch Version Repository Size
========================================================== ============================================
Installing:
Readline-devel i386 5.1-3. el5 base 146 k
Installing for dependencies:
Libtermcap-devel i386 2.0.8-46.1 base 56 k
Transaction Summary
========================================================== ============================================
Install 2 package (s)
Update 0 package (s)
Remove 0 package (s)
Total download size: 201 K
Downloading packages:
(1/2): libtermcap-devel-2 100% | =========================| 56 KB
(2/2): readline-devel-5.1 100% | =========================| 146 KB
Running rpm_check_debug
Running transaction Test
Finished transaction Test
Transaction Test Succeeded
Running Transaction
Installing: libtermcap-devel ######################### [1/2]
Installing: readline-devel ######################### [2/2]
Installed: readline-devel.i386 0: 5. 1-3.el5
Dependency Installed: libtermcap-devel.i386. 0.8-46.1
Complete!
6. Execute configure again.
7. There is another solution: add the parameter -- without-Readline to configure, but you cannot enter it in the command line. Therefore, we do not recommend this...
8. After configure is successful, make will be followed.
9 if the installation is successful after make install, the interface shown in is displayed.
10. Modify the permission of the PostgreSQL installation directory. The default installation directory is under/usr/local/pgsql.
Modify the permission command to chmod-r 777/usr/local/pgsql
After running, all files in the pgsql directory will have the xwr (X: executable, W: writable, R: readable) permission. The-R parameter in the Command recursively modifies the pgsql directory of the folder and all files in the directory to the corresponding permissions. 777 indicates that the user is added, the xwr permission is granted to other users in this user group and other users in this group.
11.
At this point, the installation of PostgreSQL is complete, and you can try to use this open source database...
1): first, initialize the database. Go to the directory/home/PG/postgr where you just installed pg (this is the directory where I installed pg. The default installation directory is/Usr/local/pgsqlInput./bin/initdb-D ../data. The command format here also needs to be checked, especially the meaning of parameters such as-D. This will generate a data folder under postgr.
2): Start the database server .. /Bin/postmaster-D. /data &. the meaning of "&" must be clarified. If this symbol is missing, it may cause some problems. It seems that another command can be used to start the database server:/bin/postgres-D. /data or. /bin/pg_ctl-D. /data-l logfile start. For the differences between these commands, check the manual or consult the TA.
3): create a local database under another command line .. /Bin/createdb testdb, where testdb is the database name. A folder is generated under the data Directory.
4): connect to the database server .. /Bin/psql testdb. Enter help for help. See
5): access the database. Enter the SQL command here, And the debugging entry will be here. Press \ q to exit.
6): Shut down the database server .. /Bin/pg_ctl stop-D./data.
12. That's all!