PostgreSQL (Linux) Install, start, stop, restart

Source: Internet
Author: User

If we don ' t already has PostgreSQL installed, we must install it.

$ sudo apt-get install PostgreSQL

This command installs the PostgreSQL server and various other packages.


$ sudo update-rc.d-f postgresql remove
removing any system startup links for/etc/init.d/postgresql ...
/etc/rc0.d/k21postgresql
/etc/rc1.d/k21postgresql
/etc/rc2.d/s19postgresql
/etc/rc3.d/s19postgresql
/etc/rc4.d/s19postgresql
/etc/rc5.d/s19postgresql
/etc/rc6.d/k21postgresql

If We install the PostgreSQL database from packages, it's automatically added to the start up scripts of the operating Sy Stem. If We are a learning to work with the database, it's unnecessary to start the database each time we boot the system. The above command removes any system startup links for the PostgreSQL database.


$/etc/init.d/postgresql Status
Running Clusters:9.1/main
$ service PostgreSQL status
Running Clusters:9.1/main

We Check if the PostgreSQL server is running. If not, we need to start the server.


$ sudo service PostgreSQL start
* Starting PostgreSQL 9.1 database server [OK]

On Ubuntu Linux We can start the server with the service PostgreSQL Start command.


$ sudo service PostgreSQL stop
* Stopping PostgreSQL 9.1 database server [OK]

We Use the service PostgreSQL Stop command to stop the PostgreSQL server.


$ sudo service PostgreSQL restart

Stopping postgresql-9.5 service: [OK]

Starting postgresql-9.5 service: [OK]

We Use the Service PostgreSQL Restart command to restart the PostgreSQL server.


PostgreSQL (Linux) Install, start, stop, restart

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.