ByC0d3
9/5/2017 - 5:16 PM

Postgres en Debian 9

Postgres en Debian9

# Iniciar Postgres
systemctl start postgresql

# Detener Postgres
systemctl stop postgresql

# Reiniciar Postgres
systemctl restart postgresql

# Ver estatus Postgres
systemctl status postgresql
nano /etc/postgresql/9.4/main/pg_hba.conf

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             192.168.163.0/24        md5
host    all             all             10.1.111.0/24           md5

# IPv6 local connections:
host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
nano /etc/postgresql/9.4/main/postgresql.conf

Cambiar
#listen_addresses = 'localhost' 

#Por 
listen_addresses = '*' 
# Instalar Postgres 9.6 en debian9
apt install postgresql-9.6