Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Databases»PostgreSQL»How to Install PostgreSQL 11 on Debian 8 (Jessie)

    How to Install PostgreSQL 11 on Debian 8 (Jessie)

    By RahulNovember 13, 20182 Mins Read

    PostgreSQL is an open source object-relational database system. It is one of leading database server used for production servers. This tutorial will help you to install the PostgreSQL database server on Debian 8 Jessie systems.

    Advertisement
    • How to Install PostgreSQL on Ubuntu

    Step 1 – Prerequsities

    First, you need to import PostgreSQL packages signing key on your system. Use the below command to import the key.

    wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
    

    Now add PostgreSQL apt repository in your system as per your operating system. These are suggested on official PostgreSQL website using following command.

    sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
    

    Step 2 – Install PostgreSQL on Debian 8

    At this stage, you have successfully added PostgreSQL official repository in your system. Now update the 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 the PostgreSQL database server by default, it creates a user ‘postgres’ with role ‘postgres’. It also creates a system account with the 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 Debian command prompt.

    postgres-# \q
    

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

    pgsql PostgreSQL psql
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Install Postgres on MacOS

    How To Install PostgreSQL on MacOS

    How to Allow Remote Connections in Postgres

    How To Configure PostgreSQL to Allow Remote Connections

    Check the PostgreSQL Version

    How to Check the PostgreSQL Version

    View 8 Comments

    8 Comments

    1. Marco Pinero on January 6, 2022 3:37 pm

      First step on prerequisites:

      gpg: no valid OpenPGP data found

      Reply
    2. Anupam on May 14, 2019 10:05 am

      For other versions of Debian, use:
      sudo sh -c ‘echo “deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main” >> /etc/apt/sources.list.d/pgdg.list’

      (note the replacement of jessie-pgdg with `lsb_release -cs`-pgdg)

      Reply
    3. vizzy on March 6, 2019 4:55 pm

      sudo -u postgres psql
      postgres=# create database mydb;
      postgres=# create user myuser with encrypted password ‘mypass’;
      postgres=# grant all privileges on database mydb to myuser;

      Reply
    4. vizzy on March 6, 2019 4:53 pm

      i am missing essential infos like setting superuser password and editing essentials in pga_hba.conf

      Reply
    5. mz on March 2, 2019 6:28 pm

      Any idea how to create a db, a user and give that user the rights to connect to the newly created db ?
      I’ve seen so many instructions which say the same thing but without actually achieving the goal.
      No matter which instruction I follow, I ALWAYS get Fatal: role … not found
      I’m looking for an instruction for postgresql 11.
      Ideally, the user connecting should not require a local unix account.
      Anyone ?

      Reply
    6. isytha on October 12, 2017 6:47 am

      hi rahul.
      do you have any idea to upgrade postgresql without losing the database?

      Reply
    7. chetan on August 2, 2017 7:00 am

      Thanks for the great article. This guide makes postgresql installation easy.

      Reply
    8. Anupam on July 4, 2017 8:03 am

      Nice and clean doc to install Postgres on Debian – thanks!

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.