ubuntu14.04 Source code Installation PostgreSQL 9.1

Source: Internet
Author: User
Tags postgresql postgis

The project needs to use Gisgraphy, Zennai gisgraphy3.0 only supports postgis1.5. So you can only install the Posgresql and PostGIS of the old version number. From the support matrix diagram of PostGIS, you can see the PostgreSQL supported by the PostGIS different version numbers,

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbg9uz3nozw5nz3vvamk=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

I installed the postgresql9.1.14.

1. Download the source code for the postgresql9.1 version number, http://www.postgresql.org/docs/9.1/static/install-short.html

2. Unzip, then switch to the extracted directory

3. Execute the command:./configure

For example, the following error may occur here:

Configure:error:readline Library not found
My workaround is: Install libreadline6-dev

sudo apt-get Installlibreadline6-dev

The problem has been solved

4. Execute the command:

Make

Make install

5. Verify that the installation is successful, enter the command:

Ls-l usr/local/pgsql/

Assume that both bin include Lib and share appear, indicating a successful installation.


6. Set up user accounts

AddUser Postgres

passwd Postgres

Input password

7. Create a PostgreSQL Data folder:

mkdir/usr/local/pgsql/data/

Chown Postgres:postgres/usr/local/pgsql/data
Ls-ld/usr/local/pgsql/data

will appear such as the following interface

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbg9uz3nozw5nz3vvamk=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/southeast ">

8. Initialize the PostgreSQL Data folder

Su Postgres

/usr/local/pgsql/bin/initdb-d/usr/local/pgsql/data/

9. Verify the PostgreSQL Data folder

Ls-l/usr/local/pgsql/data

Appears for example the following interface:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbg9uz3nozw5nz3vvamk=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/southeast ">

10. Start the Pgsql database

/usr/local/pgsql/bin/postmaster-d/usr/local/pgsql/data >logfile 2>&1 &
Cat logfile

Appears for example the following interface:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbg9uz3nozw5nz3vvamk=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/southeast ">

11. Create a PostgreSQL database. and verify that the installation is successful

/usr/local/pgsql/bin/createdb Test
/usr/local/pgsql/bin/psql Test

If it appears, for example, the following interface, congratulations, successful installation



ubuntu14.04 Source code Installation PostgreSQL 9.1

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.