Install PostgreSQL in Ubuntu

Source: Internet
Author: User

Postgresql's .gz package can be downloaded from csdn. PostgreSQL's official website does not seem to be available.

Decompress the package and enter its folder. Then, run the following command:

./Configure

The system may not find two packages. install them first:

Sudo apt-GST install libreadline5-dev

Sudo apt-GST install zlib1g-dev

Then execute

Sudo make

Sudo make install

In this way, PostgreSQL will be installed in the/usr/local/pgsql folder by default.

Add a data folder under the/usr/local/pgsal Folder:

Sudo mkdir/usr/lcoal/pgsql/Data

To use PostgreSQL, you need to add a new user. The username is random. I use Postgres:

Sudo useradd posrgres

Sudo passwd ipvs

Set the file master in the data folder to ipvs.

Sudo chown Postgres/usr/local/pgsql/Data

Start posggresql:

Su ipvs

/Usr/local/pgsql/bin/initdb-D/usr/local/pgsql/Data

/Usr/local/pgsql/bin/pg_ctl start-D/usr/local/pgsql/Data

Create:

/Usr/local/pgsql/bin/createdb test-u Postgres

/Usr/local/pgsql/bin/Psql test-u Postgres

Reference: http://hi.baidu.com/wp_sky_city/blog/item/1875f022d2211a58ac34ded8.html

 

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.