CentOS under source installation PostgreSQL 9.4

Source: Internet
Author: User
Tags auth psql readline

[email protected] ~]# Cd/home
[[email protected] home]# ls
Postgresql-9.4.1.tar Test [email protected] home]# tar XF postgresql-9.4.1.tar [email protected] home]# CD postgresql-9.4.1
[[email protected] postgresql-9.4.1]# ls
ACLOCAL.M4 Config Configure configure.in contrib COPYRIGHT doc gnumakefile.in history INSTALL Makefile README Src
[email protected] postgresql-9.4.1]#./configure
Checking build system Type ... X86_64-unknown-linux-gnu
Checking host system Type ... X86_64-unknown-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 ... 1GB
Checking for WAL block size ... 8kB
Checking for WAL segment size ... 16MB
Checking for gcc ... gcc
Checking whether the C compiler works ... yes
Checking for C compiler default output file name ... a.out
Checking for suffix of executables ...
Checking whether we is cross compiling ... no
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 whether GCC supports-wdeclaration-after-statement ... yes
Checking whether GCC supports-wendif-labels ... yes
Checking whether GCC supports-wmissing-format-attribute ... yes
Checking whether GCC supports-wformat-security ... yes
Checking whether GCC supports-fno-strict-aliasing ... yes
Checking whether GCC supports-fwrapv ... yes
Checking whether GCC supports-fexcess-precision=standard ... no
Checking whether GCC supports-funroll-loops ... yes
Checking whether GCC supports-ftree-vectorize ... 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 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 whether to build with SELinux 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's possible to strip libraries ... yes
Checking for ar ... Ar
Checking for a bsd-compatible install .../usr/bin/install-c
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 .../usr/bin/bison
Configure:using Bison (GNU bison) 2.4.1
Checking for flex ... no
Configure:warning:
Without Flex you are not being able to build PostgreSQL from Git nor
Change any of the scanner definition files. You can obtain Flex from
A GNU mirror site. (If you are using the official distribution of
PostgreSQL then don't need to worry on this because the Flex
Output is pre-generated.)
Checking for Perl .../usr/bin/perl
Configure:using Perl 5.10.1
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 shm_open ...-lrt
Checking for library containing shm_unlink ... none required
Checking for library containing fdatasync ... none required
Checking for library containing gethostbyname_r ... none required
Checking for library containing shmget ... none required
Checking for library containing readline ... no
Configure:error:readline Library not found
If you had readline already installed, see Config.log for details on the
failure. It is possible the compiler "t looking in the proper directory.Use --without-readline to disable ReadLine support.#缺少readline Library#检查系统是否安装readlilne包[Email protected] postgresql-9.4.1]# Rpm-qa | grep readlinereadline-6.0-4.el6.x86_64#通过yum搜索相关的readline包[email protected] postgresql-9.4.1]# Yun search ReadLine
-bash:yun:command not found
[email protected] postgresql-9.4.1]# Yum search ReadLine
Loaded Plugins:fastestmirror, Refresh-packagekit, security
Determining fastest Mirrors
* base:mirror.bit.edu.cn
* Extras:mirrors.btte.net
* updates:mirror.bit.edu.cn
Base | 3.7 KB 00:00
Extras | 3.4 KB 00:00
extras/primary_db | KB 00:00
Updates | 3.4 KB 00:00
updates/primary_db | 4.4 MB 00:17
==================================================== N/S matched:readline ======================================= ==============
Compat-readline5-devel.i686:files needed to develop programs which use the ReadLine library
Compat-readline5-devel.x86_64:files needed to develop programs which use the ReadLine library
Compat-readline5-static.x86_64:static libraries for the ReadLine library
Libreadline-java-javadoc.x86_64:javadoc for Libreadline-java
Readline-devel.i686:files needed to develop programs which use the ReadLine library
Readline-devel.x86_64:files needed to develop programs which use the ReadLine library
Readline-static.x86_64:static libraries for the ReadLine library
COMPAT-READLINE5.I686:A Library for editing typed command lines
COMPAT-READLINE5.X86_64:A Library for editing typed command lines
Libreadline-java.x86_64:java wrapper for the Editline library
Perl-term-ui.x86_64:term::readline UI Made Easy
READLINE.I686:A Library for editing typed command lines
READLINE.X86_64:A Library for editing typed command lines

Name and summary matches only, use ' Search all ' for everything.#安装readline-devel Bag[Email protected] postgresql-9.4.1]# yum-y install-y readline-devel.x86_64execute configure successfully again. ---------------------------[[email protected] postgresql-9.4.1]# adduser postgres[[email protected] postgresql-9.4.1 ]# Mkdir/data/pgsql
[Email protected] postgresql-9.4.1]# Mkdir/log
[Email protected] postgresql-9.4.1]# Mkdir/data/log
[Email protected] postgresql-9.4.1]# Mkdir/data/log/pgsql
[Email protected] postgresql-9.4.1]# chown-r postgres.postgres/data/pgsql
[Email protected] postgresql-9.4.1]# chown-r postgres.postgres/data/log/pgsql
[email protected] postgresql-9.4.1]# su postgres
[Email protected] postgresql-9.4.1]$ Cd/usr/local/pgsql/bin
[[email protected] bin]$ ls
Clusterdb createuser dropuser pg_basebackup pg_ctl pg_isready pg_resetxlog postmaster Vacuumdb
Createdb dropdb ECPG pg_config pg_dump pg_receivexlog pg_restore psql
Createlang Droplang initdb pg_controldata pg_dumpall pg_recvlogical postgres reindexdb
[Email protected] bin]$/initdb-d/data/pgsql
The files belonging to this database system is owned by user "Postgres".
This user must also own the server process.

The database cluster is initialized with locale "en_US. UTF-8 ".
The default database encoding have accordingly been set to "UTF8".
The default text search configuration is set to "中文版".

Data page checksums is disabled.

Fixing permissions on existing Directory/data/pgsql ... ok
Creating subdirectories ... ok
Selecting Default Max_connections ... 100
Selecting Default Shared_buffers ... 128MB
Selecting dynamic shared memory implementation ... POSIX
Creating configuration files ... ok
Creating Template1 database In/data/pgsql/base/1 ... ok
Initializing Pg_authid ... ok
Initializing dependencies ... ok
Creating system views ... ok
Loading system objects ' descriptions ... ok
Creating collations ... ok
Creating conversions ... ok
Creating dictionaries ... ok
Setting privileges on built-in objects ... ok
Creating Information Schema ... ok
Loading Pl/pgsql server-side language ... ok
Vacuuming database template1 ... ok
Copying template1 to Template0 ... ok
Copying template1 to Postgres ... ok
Syncing data to disk ... ok

Warning:enabling "Trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option-a, or
--auth-local and--auth-host, the next time you run INITDB.

Success. You can now start the database server using:

./postgres-d/data/pgsql
Or
./pg_ctl-d/data/pgsql-l LogFile Start

[Email protected] bin]$/postgres-d/data/pgsql >/data/log/pgsql/logfile 2>&1 &The service starts. Next, set the environment variables.

Each time you start the database service to enter the bin directory of the PG, and then knock a bunch of commands or something is not convenient, rather than directly under the bin executable program added to the user environment variables. This can be done in the following ways.

Open the user's environment profile, which is under/home/postgres/. Profiles, open with vim command (if no VIM can be installed via sudo apt-get install vim). At the end add:

Export Pgdata=/data/pgsql

Export path= $PATH:/usr/local/pgsql/bin

Pgdata is the database file directory specified after postgres–d, through such settings, if you run Postgres or pg_ctl start directly then the database file will be stored in the/data/pgsql directory by default.

At this point, the installation of PG end, the user in the state of the database service, you can use the Psql client to connect and access the database, through the SQL language to operate.

CentOS under source installation PostgreSQL 9.4

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.