• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to Install PostgreSQL 9.6 on Debian 8

1253

To Install PostgreSQL 9.6 on Debian 8

Relational databases have become an essential tool for a multitude of services which ranges from online shopping to rocket launches. PostgreSQL, an open-source relational database, is one such database which is widely used among the webmasters for data storage purposes and for production servers. This tutorial will help you to install PostgreSQL database server on Debian 8.

Installing PostgreSQL

Configuring your apt repository is very essential for installing PostgreSQL. So, create a file at /etc/apt/sources.d/ postgeresql.list by using the following command.

root@linuxhelp:~# vim /etc/apt/sources.list.d/postgeresql.list

Add the following line according to your distribution (xenial, utopic, trusty, jessie, wheezy and etc)

deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main

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

root@linuxhelp:~# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
OK

Once it is done, update repository list as follows.

root@linuxhelp:~# apt-get update
Hit http://security.debian.org jessie/updates InRelease
Hit http://security.debian.org jessie/updates InRelease                             
Hit http://security.debian.org jessie/updates/main Sources                           
Hit http://security.debian.org jessie/updates/contrib Sources                               
Hit http://security.debian.org jessie/updates/main amd64 Packages              
Hit http://security.debian.org jessie/updates/contrib amd64 Packages                          
Hit http://security.debian.org jessie/updates/contrib Translation-en
.
.
Ign http://apt.postgresql.org xenial-pgdg/main Translation-en
Fetched 98.8 kB in 5s (17.4 kB/s)
Reading package lists... Done

After the update, install Latest PostgreSQL Server in your Ubuntu system using following command.

root@linuxhelp:~# apt-get install postgresql-9.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libpq5 pgdg-keyring postgresql-client-9.6 postgresql-client-common postgresql-common
  postgresql-contrib-9.6
Suggested packages:
  locales-all postgresql-doc-9.6 libdbd-pg-perl
Recommended packages:
  sysstat
The following NEW packages will be installed:
  libpq5 pgdg-keyring postgresql-9.6 postgresql-client-9.6 postgresql-client-common postgresql-common
  postgresql-contrib-9.6
0 upgraded, 7 newly installed, 0 to remove and 95 not upgraded.
Need to get 6,280 kB of archives.
After this operation, 29.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
.
.
Processing triggers for libc-bin (2.19-18+deb8u6) ...
Processing triggers for systemd (215-17+deb8u5) ...

After installing 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.

root@linuxhelp:~# su - postgres
postgres@linuxhelp:~$ psql
psql (9.6.2)

Type " help" for help.

postgres=# help

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

postgres=# conninfo

You are connected to database " postgres" as user " postgres" via socket in " /var/run/postgresql" at port " 5432" .

postgres=# 

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

postgres=# q

Your PostgreSQL installation has been completed successfully. PostgreSQL has several uses as it is designed with most of the SQL standard. It also has ACID transactions, and supports foreign keys and views.

Tags:
elijah
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

"Where can I get PostgreSQL?

A

"There are binary distributions for various operating systems and platforms; see our download area. The source code can be obtained via the web browser or through ftp

Q

"What is the most recent release?

A

"the latest release of PostgreSQL is shown on the front page of our website. We typically have a major release every year, with minor releases every few months. Minor releases are usually made

Q

"Who is the PostgreSQL Global Development Group?

A

"The " PGDG"" is an international, unincorporated association of individuals and companies who have contributed to the PostgreSQL project. The PostgreSQL Core Team generally act as spokespeople for the PGDG.

Q

"How does PostgreSQL compare to other DBMSs?

A

"There are several ways of measuring software: features, performance, reliability, support, and price.

Q

"When installing from source code, how do I install PostgreSQL somewhere other than /usr/local/pgsql?

A

"Specify the --prefix option when running configure.

Related Tutorials in How to Install PostgreSQL 9.6 on Debian 8

Related Tutorials in How to Install PostgreSQL 9.6 on Debian 8

How to install Gparted on Debian 9.0
How to install Gparted on Debian 9.0
Sep 13, 2017
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Sep 19, 2018
How to install and update OpenSSL on Debian 11.3
How to install and update OpenSSL on Debian 11.3
Oct 21, 2022
How to install qBittorrent on Debian 9.0
How to install qBittorrent on Debian 9.0
Sep 8, 2017
How to Install FileZilla in Debian
How to Install FileZilla in Debian
Nov 29, 2016
How to install Nmap on Debian 9.0
How to install Nmap on Debian 9.0
Sep 9, 2017
How to Install Laravel in Debian
How to Install Laravel in Debian
Dec 7, 2016
How to install Wireshark in Debian
How to install Wireshark in Debian
Mar 18, 2017

Related Forums in How to Install PostgreSQL 9.6 on Debian 8

Related Forums in How to Install PostgreSQL 9.6 on Debian 8

PostgreSQL
stalin class=
How to uninstall postgresql from ubuntu
Nov 2, 2017
MariaDB
ryan class=
E: Unable to locate package mariadb-server
Sep 18, 2017
PostgreSQL
tommyhilten class=
Phpmyadmin : Login disallowed for security reasons in postgresql
Nov 3, 2017
Linux
AadrikaAnshu class=
How to add timestamps to history On Any Linux Machine
Jun 18, 2019
vim
jacob class=
Change true vi-compatible editor from Debian Vim-compatible
Nov 8, 2021
CentOS
jayce class=
Psql : could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.45432"?
May 30, 2019
PostgreSQL
michael class=
Postgres password authentication fails
Nov 3, 2021
debian
anandaamatya class=
RedNotebook on Debian buster
Jun 30, 2020

Related News in How to Install PostgreSQL 9.6 on Debian 8

Related News in How to Install PostgreSQL 9.6 on Debian 8

Debian IceDove kicks the bucket after Thunderbird revisits Debian Repositories
Debian IceDove kicks the bucket after Thunderbird revisits Debian Repositories
Feb 28, 2017
Mass update of Jessie - A better alternative to new version?
Mass update of Jessie - A better alternative to new version?
May 8, 2017
Amazon Web Services offers Aurora Cloud DB accordant with PostgreSQL
Amazon Web Services offers Aurora Cloud DB accordant with PostgreSQL
Oct 27, 2017
Debian 9.2 ‘Stretch’ OS is here, download distro now
Debian 9.2 ‘Stretch’ OS is here, download distro now
Oct 9, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Lucas ?
Various options in Top command

Am using Top command only to view the load average, what are the various options in Top command..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.