Overview

PostegreSQL is open source database offered under the license of GPL and is supported by the community. The installation of postegresql is rather simple.

Installation

Installation is composed by 3 steps:

Installation of the Repositories

Installation of the Packages

Installation of the Server

The configuration is done afterwards.

Install the Repositories

Install the packages

Install the server

Configuration

Configuration of the server is initially done as follows:

Server Configuration

For Linux 6:

You can also start the database as follows, if you don't have a service:

For >= 7

Initial connection and Password management

In order to log in, you have to set the password initially as follows:

Allow external Connections

In order to allow, external connections, you show change the listening for PostgreSQL. By default, PostgreSQL listens only on the loopback IP (e.g. 127.0.0.1) so you better change that to '*' (all) if you want to be accessible to all IPs which are on the server or put specific IP, as follows:

Like that, PostgreSQL will listen on port 5432 for IP: 192.168.0.178. You can also change the port (as soon as it isn't taken with the following setting:

That PostgreSQL listens on certain port, doesn't mean it will allow users to the database. The user connection settings are specified in the pg_hba.conf file in the PGDATA directory (by default). In order to allow a connection you have to add an entry there, per specified syntax:

Where the fields stands for:

Source can be either: Host (for external connections) or Local (for local connections)

The database to which you wish to connect, can be: “all” or particular database

User which will be user or (+ = role)

Address which the connection will be coming (omitted for local and IP for host type)

Method of the authentication: md5(old), trust, ident, AES and others

OPTIONS - additional options like LDAP (Pam) and so on.