ubuntu 14.04安裝postgresql最新版本

來源:互聯網
上載者:User

標籤:user   .post   rod   postgre   nload   ems   bsp   off   ima   

官網: https://www.postgresql.org/download/linux/ubuntu/

--------------------------------------------------------------------------------------------------------------------

另一篇文章,講的差不多也是這個:

http://tecadmin.net/install-postgresql-server-on-ubuntu/#

 

PostgreSQL is an open source object-relational database system. It is one of leading database server used for production servers. PostgreSQL allows us to execute stored procedures in various programming languages, like C/C++, Python, Java, Perl, Ruby and its own PL/pgSQL, which is similar to Oracle’s PL/SQL

This article will help you for installing PostgreSQL database server on your Ubuntu systems.

Step 1: Add PostgreSQL Apt Repository

PostgreSQL packages are also available in default Ubuntu repository, But when I try to install PostgreSQL on Ubuntu 12.04 I only found PostgreSQL 9.1 was in default apt repository. So I request you to add PostgreSQL apt repository first in your system suggested on official PostgreSQL website using following command.

$ sudo sh -c ‘echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list‘$ wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
Step 2: Install PostgreSQL

Now as we have added PostgreSQL official repository in our system, First we need to update repository list. After that install Latest PostgreSQL Server in our Ubuntu system using following commands.

$ sudo apt-get update$ sudo apt-get install postgresql postgresql-contrib
Step 3: Connect to PostgreSQL

After installing PostgreSQL database server, by default it creates a user ‘postgres’ with role ‘postgres’. It also creates a system account with same name ‘postgres’. So to connect to postgres server, login to your system as user postgres and connect database.

$ sudo su - postgres$ psql

Now you are logged in to PostgreSQL database server. To check login info use following command from database command prompt.

postgres-# \conninfo

To disconnect from PostgreSQL database command prompt just type below command and press enter. It will return you back to Ubuntu command prompt.

postgres-# \q

Your PostgreSQL installation has been completed successfully. Let’s move to phpPgAdmin installation of Ubuntu systems.

ubuntu 14.04安裝postgresql最新版本

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.