postgresql9.3.9 Version Deployment

Source: Internet
Author: User
Tags bz2 postgresql postgresql commands psql

Installation method: Source Package Installation
Installation Environment: Linux-centos 6.5

  1. Download PostgreSQL Source Package
    wget http://ftp.postgresql.org/pub/source/v9.3.9/postgresql-9.3.9.tar.bz2
    #地址可更改, need other package into Http://ftp.postgresql.org/pub/source find download
  2. Unzip the file
    Tar xjvf postgresql-9.3.9.tar.bz2
  3. Enter the extracted directory
    CD postgresql-9.3.9/
  4. View the install file.

    The short version section of the install file explains how to install PostgreSQL commands, requirements section describes the Lib that is dependent on the installation of PostgreSQL, long, first configure try, if error occurs, Then you need to check whether the requirements requirements are met.
    If you report an error such as Rebline missing, you need to install the appropriate dependency package first.

    Short Version./configuregmakesugmake installadduser postgresmkdir /usr/local/pgsql/datachown postgres /usr/local/pgsql/datasu - postgres/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &/usr/local/pgsql/bin/createdb test/usr/local/pgsql/bin/psql test
  5. Execute the commands in order, such as the previous short, to start compiling and installing the Postgrepsql database.
    1)./configure

    In this step may be reported lack of redeline or zlib and other environmental dependency missing problem, download the relevant missing software through Yum. For example: Yum install-y readline-devel

2) Make
3) make install
4) Add PostgreSQL admin start user Postgres
Useradd Postgres
passwd Postgres
5) Create a database file storage folder
Mkdir/usr/local/pgsql/data
6) Change the permissions of the folder in the previous directory
Chown-r Postgres.postgres/usr/local/pgsql
7) Switch User
Su-postgres
8) Bind database file storage directory
/usr/local/pgsql/bin/initdb-d/usr/local/pgsql/data
#or: Export path= $PATH:/usr/local/pgsql/bin/
9) Start the database
/usr/local/pgsql/bin/pg_ctl-d/usr/local/pgsql/data >>logfile 2>&1?
#这一步是用pg_ctl命令指定数据目录启动 start-up logs in LogFile and other startup methods can also be
10) Create test database--test and insert data test (optional)
/usr/local/pgsql/bin/createdb Test
/usr/local/pgsql/bin/psql Test

 psql (9.3.9)Type "help" for help.test=#
test=# create table table1 (test(# id integertest(# );CREATE TABLEtest=#
test=# insert into table1 values(1);INSERT 0 1test=# select * from table1;Id

Query to the inserted data, at which point the database deployment is complete.
The next article on the 9.3.9 version is based on the method of the dual-machine hot standby mode of stream replication.

postgresql9.3.9 Version Deployment

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.