PostgreSQL source installation on Linux

Source: Internet
Author: User
Tags bz2 postgresql readline

http://my.oschina.net/hippora/blog/375292 Download Source and unzip
[root@fnddb ~]# wget https://ftp.postgresql.org/pub/source/v9.4.0/postgresql-9.4.0.tar.bz2[root@fnddb ~]# tar -xjvf postgresql-9.4.0.tar.bz2 [root@fnddb ~]# cd postgresql-9.4.0
Start compiling the installation
[Email protected] postgresql-9.4.0]#./configure ... checkingForLibrary containing shmget ... none requiredcheckingForlibrary containing readline ... noconfigure:error:readline < Span class= "Hljs-keyword" >library not foundif you had readline already installed, see Config.log for details on Thefailure. It is possible the compiler Isn< Span class= "Hljs-attribute" "T looking in the proper Directory . use  --without-readline to disable ReadLine support.           
Follow the error prompts to install the dependent packages in turn
[[email protected] postgresql-9.4.0]# yum install readline-devel[[email protected] postgresql-9.4.0]# yum install zlib-devel...
Go on
[Root@fnddb postgresql-9.4.0]#. Configure[root @fnddb postgresql- 9.4.0] # make ... All of PostgreSQL successfully made. Ready to install.[ Root @fnddb postgresql-9.4. 0]# Make install ... PostgreSQL installation complete.             
Add user
[Root@fnddb postgresql-9.4.0]# Useradd Postgres[root@fnddb postgresql-9.4.0] # passwd postgreschanging Password for user postgres. New password:bad password: it is based  on a dictionary wordretype new Span class= "Hljs-attribute" >password: passwd:all authentication tokens updated successfully.        
Set up Database cluster target folder.
[root@fnddb postgresql-9.4.0]# mkdir /var/lib/pgsql/data -p[root@fnddb postgresql-9.4.0]# chown -R postgres /var/lib/pgsql
environment variable Settings
[Root@fnddb postgresql-9.4.0]# Su-postgres[postgres@fnddb ~]$ VI. Bash_profile ...# postgresPGDATA=/var/lib/pgsql/ Datapath= /usr/local/pgsql/bin: $PATHexport Span class= "hljs-constant" >pgdata  path[postgres @fnddb ~]$: Bash_profile        
Create DATABASE Cluster
[Email protected] ~]$ pg_ctl initdb ... Warning:enabling "Trust" authentication for local connectionsyou canChangeThisByEditing pg_hba.confOr UsingTheOption-A,Or--auth-local and--auth-host, the next time you run INITDB.Success. You canNow StartTheDatabase Server Using:/usr/Local/pgsql/Bin/postgres-d/Var/lib/pgsql/Dataor /usr/local/pgsql/bin/pg_ctl-d/var/lib/pgsql/Data- l logfile  start            
Start a DB instance

After setting the PGDATA environment variable, you can do so without the-D option

start -l /var/lib/pgsql/pgsql.logserver starting
To close a DB instance
stopwaiting for server to shut down.... doneserver stopped
Boot auto-start settings
[[email protected] postgresql-9.4.0]# vi /etc/rc.local…su - c ‘/usr/local/pgsql/bin/pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/pgsql.log‘

PostgreSQL source installation on Linux

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.