Dear readers of our blog, we'd like to recommend you to visit the main page of our website, where you can learn about our product SQLS*Plus and its advantages.
 
SQLS*Plus - best SQL Server command line reporting and automation tool! SQLS*Plus is several orders of magnitude better than SQL Server sqlcmd and osql command line tools.
 

REQUEST COMPLIMENTARY SQLS*PLUS LICENCE

Enteros UpBeat offers a patented database performance management SaaS platform. It proactively identifies root causes of complex revenue-impacting database performance issues across a growing number of RDBMS, NoSQL, and deep/machine learning database platforms. We support Oracle, SQL Server, IBM DB2, MongoDB, Casandra, MySQL, Amazon Aurora, and other database systems.

How to install PostgreSQL on Debian 9

27 September 2020

Preamble

SQLS*Plus - 1649773502143149D97F6 0390 4DCC B8E5 11EA71908D3F optimize

​​

We will show you how to install PostgreSQL on Debian 9. PostgreSQL is an object-relational database management system written in C.

It is a free and open-source system, whose main functions are to safely store data and return data as an answer to other application queries. Installing PostgreSQL on Debian 9 is quite an easy task and should not take more than 10 minutes to complete the installation of PostgreSQL on Debian. Let’s get started.

Before starting the installation phase, make sure you have full access to your Debian 9 VPS, or at least you have a system user with sudo privileges. If you do, connect to your server via SSH and make sure that all your system software is up-to-date. First, update the package index using the following command:

apt-get update

After updating the package index, you can update all your system software to the latest version using the following command:

apt-get upgrade

This may take from a few seconds to a few minutes depending on the software to be updated.

Installing PostgreSQL on Debian 9

The next step is to install the PostgreSQL database system on your Debian 9 VPS. This step is quite simple, just run the next command:

apt-get install postgresql

It will install the PostgreSQL database server, client, and other necessary tools.

To check if the PosgreSQL server/client is installed, you can use the following command:

psql --version

It will show you the current version of PostgreSQL installed on your server:

# psql --version
psql (PostgreSQL) 9.6.7

PostgreSQL management on Debian 9

Now that the PostgreSQL installation is complete, it’s good to know how you can manage PostgreSQL service on your PostgreSQL VPS. To run the PostgreSQL service, run the following command on your terminal:

systemctl start postgresql.service

To stop the PostgreSQL service, you can use the following command:

systemctl stop postgresql.service

To restart the service, you can run the following command:

systemctl restart postgresql.service

To check the status of the PostgreSQL service, run the following command:

systemctl status postgresql.service

If PostgreSQL is running and running on your Linux VPS at the moment, the output will be similar to the following:

# systemctl status postgresql.service
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Sat 2018-07-21 10:57:16 CDT; 40min ago
Main PID: 1018 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/postgresql.service

To enable the PostgreSQL service when booting the system, run the following command:

systemctl enable postgresql.service

If you want PostgreSQL to shut down at system startup, run the following command:

systemctl disable postgresql.service

If you want to manage PostgreSQL file locations, connections, and authentication, resource utilization, logging, etc., you need to edit the main configuration file. The main configuration file for PostgreSQL is in /etc/postgresql/VERSION-NUMBER/main. So, if your PostgreSQL version is 9.6, the location is /etc/postgresql/9.6/main/postgresql.conf.

You can use any text editor of your choice to open and edit a configuration file for PostgreSQL. The file consists of lines in the form NAME = VALUE and makes sure your changes are valid. Otherwise, PostgreSQL will not work. The configuration file is read when you start the server, so you need to restart the PostgreSQL service for the changes to take effect.

systemctl restart postgresql.service

Main use of PostgreSQL on Debian 9

To access the PostgreSQL command-line interface and manage databases, you must login as a postgres user. Perform the following command:

su - postgres

Now to enter the PostgreSQL interactive terminal, execute the following command:

PSQL

Your shell will change as follows:

~$ psql
psql (9.6.7)
Type "help" for help.

postgres=#

Now you can execute a command specific to PostgreSQL. For example, to list all current databases that you can enter \l clickEptag.

postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)

You can also create databases and tables, insert data, extract data, and do more with PostgreSQL interactive terminal. For more information, you can check the official PostgreSQL documentation.

If you prefer to use the graphical user interface to manage databases and saved data, we can recommend you to install and use phpPgAdmin. This is a PostgreSQL web-based administration tool similar to phpMyAdmin for managing the MySQL database system.

How to Install PostgreSQL 9.6 on Debian 8

Enteros

About Enteros

Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of RDBMS, NoSQL, and machine learning database platforms.

 
Tags: ,

MORE NEWS

 

Preamble​​NoSql is not a replacement for SQL databases but is a valid alternative for many situations where standard SQL is not the best approach for...

Preamble​​MongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq...

5 Database management trends impacting database administrationIn the realm of database management systems, moreover half (52%) of your competitors feel...

The data type is defined as the type of data that any column or variable can store in MS SQL Server. What is the data type? When you create any table or...

Preamble​​MS SQL Server is a client-server architecture. MS SQL Server process starts with the client application sending a query.SQL Server accepts,...

First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all...

Preamble​​Atom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to...

Preamble​​MongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather...

FlexibilityOne of the most advertised features of MongoDB is its flexibility.  Flexibility, however, is a double-edged sword. More flexibility means more...

Preamble​​SQLShell is a cross-platform command-line tool for SQL, similar to psql for PostgreSQL or MySQL command-line tool for MySQL.Why use it?If you...

Preamble​​Writing an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert...

Preamble​​Oracle Coherence is a distributed cache that is functionally comparable with Memcached. In addition to the basic function of the API cache, it...

Preamble​​IBM pureXML, a proprietary XML database built on a relational mechanism (designed for puns) that offers both relational ( SQL / XML ) and...

  What is PostgreSQL array? In PostgreSQL we can define a column as an array of valid data types. The data type can be built-in, custom or enumerated....

Preamble​​If you are a Linux sysadmin or developer, there comes a time when you need to manage an Oracle database that can work in your environment.In this...

Preamble​​Starting with Microsoft SQL Server 2008, by default, the group of local administrators is no longer added to SQL Server administrators during the...