Step-by-step | PostgreSQL 11 Admin Guide on Debian GNU/Linux

February 5, 2019 | By the+gnu+linux+evangelist | Filed in: Tutorial.

Debian PostgreSQL 11 Admin

You are Welcome! This Article Resume the Start-Up Procedure Following to Installation for Getting-Started with PostgreSQL 11 CLI and GUI Administration in Debian GNU/Linux.

And this Debian PostgreSQL 11 Admin Guide let you make the First Steps Easily with PostgreSQL 11 Database.

Furthermore, the Procedure Described is Expressly Resumed in Few Words to Give Focus to the Essential Commands Needed to the Initial SetUp.

Finally, the post include also informations on Installing PostgreSQL 11 on Debian and PostgreSQL 11 Online Docs.

PostgreSQL 11 Admin Guide Debian Linux - Featured
  1. How to Install the PostgreSQL 11 Server on Debian

    PostgreSQL 11 Debian Install
  2. First Make Needed Directories

    sudo mkdir -p /home/postgres/data

    Set postgres as Owner with:

    sudo chown -R postgres:postgres /home/postgres
  3. Set the postgres User Password

    sudo passwd postgres

    Give a Password to the postgres User Account.
    If Got “User is Not in Sudoers file” then see: How to Enable sudo

  4. Login as the postgres User

    su postgres

    Change to the Home Directory:

  5. And Setup User’s Path

    echo "export PATH=$PATH:/usr/lib/postgresql/10/bin" 
    >> /var/lib/postgresql/.bashrc

    Load the New PATH with:

    source .bashrc
  6. Then Setup First PostgreSQL DB Cluster

    initdb -D /home/postgres/data
  7. Next ReStart PostgreSQL Server

    service postgresql restart
  8. Create a PostgreSQL test Database

    createdb test
  9. Access PostgreSQL Database CLI
    First Set the postgres Database’s Password:

    psql template1
    template1# password postgres

    And Exit with:

    template1# \q

    Then to Access test Database:

    psql test
  10. Then to Create a Table

    CREATE TABLE account(
        user_id serial PRIMARY KEY,
        username VARCHAR (50) UNIQUE NOT NULL 
  11. Next to List Tables

  12. Again Listing Databases


    ‘q’ to Quit.
    For More See PostgreSQL 11 Online Documentation

  13. Finally, to Delete test Database

    dropdb test
  14. For PostgreSQL 11 GUI Administration Install PgAdmin 4

    PgAdmin4 on Debian Install