Instalação PostgreSQL 9.6 em CentOS 7

[ricardo@pg01 ~]$ sudo yum -y install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
[sudo] password for ricardo:
Plugins carregados: fastestmirror
pgdg-centos96-9.6-3.noarch.rpm                                                                                                                   | 4.7 kB  00:00:00
Examinando /var/tmp/yum-root-AfJZ1W/pgdg-centos96-9.6-3.noarch.rpm: pgdg-centos96-9.6-3.noarch
Marcando /var/tmp/yum-root-AfJZ1W/pgdg-centos96-9.6-3.noarch.rpm para ser instalado
Resolvendo dependências
--> Executando verificação da transação
---> O pacote pgdg-centos96.noarch 0:9.6-3 será instalado
--> Resolução de dependências finalizada

Dependências resolvidas

========================================================================================================================================================================
 Package                                 Arq.                             Versão                            Repo                                                   Tam.
========================================================================================================================================================================
Instalando:
 pgdg-centos96                           noarch                           9.6-3                             /pgdg-centos96-9.6-3.noarch                           2.7 k

Resumo da transação
========================================================================================================================================================================
Instalar  1 Package

Tamanho total: 2.7 k
Tamanho depois de instalado: 2.7 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Instalando   : pgdg-centos96-9.6-3.noarch                                                                                                                         1/1
  Verifying    : pgdg-centos96-9.6-3.noarch                                                                                                                         1/1

Instalados:
  pgdg-centos96.noarch 0:9.6-3

Concluído!
[ricardo@pg01 ~]$ sudo yum -y install postgresql96 postgresql96-devel postgresql96-contrib postgresql96-libs postgresql96-test postgresql96-server postgresql96-docs
Plugins carregados: fastestmirror
pgdg96                                                                                                                                           | 4.1 kB  00:00:00
(1/2): pgdg96/7/x86_64/group_gz                                                                                                                  |  333 B  00:00:01
(2/2): pgdg96/7/x86_64/primary_db                                                                                                                | 125 kB  00:00:03
Loading mirror speeds from cached hostfile
 * base: centos.xpg.com.br
 * extras: centos.xpg.com.br
 * updates: centos.xpg.com.br
Resolvendo dependências
--> Executando verificação da transação
---> O pacote postgresql96.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
---> O pacote postgresql96-contrib.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
--> Processando dependência: libxslt.so.1(LIBXML2_1.0.22)(64bit) para o pacote: postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64
--> Processando dependência: libxslt.so.1(LIBXML2_1.0.18)(64bit) para o pacote: postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64
--> Processando dependência: libxslt.so.1(LIBXML2_1.0.11)(64bit) para o pacote: postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64
--> Processando dependência: libxslt.so.1()(64bit) para o pacote: postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64
---> O pacote postgresql96-devel.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
---> O pacote postgresql96-docs.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
---> O pacote postgresql96-libs.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
---> O pacote postgresql96-server.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
---> O pacote postgresql96-test.x86_64 0:9.6.1-1PGDG.rhel7 será instalado
--> Executando verificação da transação
---> O pacote libxslt.x86_64 0:1.1.28-5.el7 será instalado
--> Resolução de dependências finalizada

Dependências resolvidas

========================================================================================================================================================================
 Package                                         Arq.                              Versão                                       Repo                               Tam.
========================================================================================================================================================================
Instalando:
 postgresql96                                    x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            1.3 M
 postgresql96-contrib                            x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            561 k
 postgresql96-devel                              x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            1.8 M
 postgresql96-docs                               x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                             12 M
 postgresql96-libs                               x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            308 k
 postgresql96-server                             x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            4.2 M
 postgresql96-test                               x86_64                            9.6.1-1PGDG.rhel7                            pgdg96                            1.5 M
Instalando para as dependências:
 libxslt                                         x86_64                            1.1.28-5.el7                                 base                              242 k

Resumo da transação
========================================================================================================================================================================
Instalar  7 Packages (+1 Dependent package)

Tamanho total do download: 22 M
Tamanho depois de instalado: 79 M
Downloading packages:
(1/8): libxslt-1.1.28-5.el7.x86_64.rpm                                                                                                           | 242 kB  00:00:00
(2/8): postgresql96-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                                 | 1.3 MB  00:00:02
(3/8): postgresql96-devel-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                           | 1.8 MB  00:00:00
(4/8): postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                         | 561 kB  00:00:02
(5/8): postgresql96-libs-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                            | 308 kB  00:00:01
(6/8): postgresql96-docs-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                            |  12 MB  00:00:05
(7/8): postgresql96-test-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                            | 1.5 MB  00:00:00
(8/8): postgresql96-server-9.6.1-1PGDG.rhel7.x86_64.rpm                                                                                          | 4.2 MB  00:00:07
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                   2.0 MB/s |  22 MB  00:00:11
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Instalando   : postgresql96-libs-9.6.1-1PGDG.rhel7.x86_64                                                                                                         1/8
  Instalando   : postgresql96-9.6.1-1PGDG.rhel7.x86_64                                                                                                              2/8
  Instalando   : postgresql96-devel-9.6.1-1PGDG.rhel7.x86_64                                                                                                        3/8
  Instalando   : postgresql96-server-9.6.1-1PGDG.rhel7.x86_64                                                                                                       4/8
  Instalando   : libxslt-1.1.28-5.el7.x86_64                                                                                                                        5/8
  Instalando   : postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64                                                                                                      6/8
  Instalando   : postgresql96-test-9.6.1-1PGDG.rhel7.x86_64                                                                                                         7/8
  Instalando   : postgresql96-docs-9.6.1-1PGDG.rhel7.x86_64                                                                                                         8/8
  Verifying    : postgresql96-devel-9.6.1-1PGDG.rhel7.x86_64                                                                                                        1/8
  Verifying    : postgresql96-9.6.1-1PGDG.rhel7.x86_64                                                                                                              2/8
  Verifying    : postgresql96-docs-9.6.1-1PGDG.rhel7.x86_64                                                                                                         3/8
  Verifying    : libxslt-1.1.28-5.el7.x86_64                                                                                                                        4/8
  Verifying    : postgresql96-libs-9.6.1-1PGDG.rhel7.x86_64                                                                                                         5/8
  Verifying    : postgresql96-server-9.6.1-1PGDG.rhel7.x86_64                                                                                                       6/8
  Verifying    : postgresql96-test-9.6.1-1PGDG.rhel7.x86_64                                                                                                         7/8
  Verifying    : postgresql96-contrib-9.6.1-1PGDG.rhel7.x86_64                                                                                                      8/8

Instalados:
  postgresql96.x86_64 0:9.6.1-1PGDG.rhel7               postgresql96-contrib.x86_64 0:9.6.1-1PGDG.rhel7          postgresql96-devel.x86_64 0:9.6.1-1PGDG.rhel7
  postgresql96-docs.x86_64 0:9.6.1-1PGDG.rhel7          postgresql96-libs.x86_64 0:9.6.1-1PGDG.rhel7             postgresql96-server.x86_64 0:9.6.1-1PGDG.rhel7
  postgresql96-test.x86_64 0:9.6.1-1PGDG.rhel7

Dependência(s) instalada(s):
  libxslt.x86_64 0:1.1.28-5.el7

Concluído!
[ricardo@pg01 ~]$ sudo systemctl enable postgresql-9.6
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-9.6.service to /usr/lib/systemd/system/postgresql-9.6.service.
[ricardo@pg01 ~]$ sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
Initializing database ... OK

[ricardo@pg01 ~]$ sudo systemctl start postgresql-9.6
[ricardo@pg01 ~]$ sudo systemctl status postgresql-9.6
● postgresql-9.6.service - PostgreSQL 9.6 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.6.service; enabled; vendor preset: disabled)
   Active: active (running) since Sáb 2016-12-31 14:06:11 BRST; 6s ago
  Process: 2185 ExecStartPre=/usr/pgsql-9.6/bin/postgresql96-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 2190 (postmaster)
   CGroup: /system.slice/postgresql-9.6.service
           ├─2190 /usr/pgsql-9.6/bin/postmaster -D /var/lib/pgsql/9.6/data/
           ├─2193 postgres: logger process
           ├─2195 postgres: checkpointer process
           ├─2196 postgres: writer process
           ├─2197 postgres: wal writer process
           ├─2198 postgres: autovacuum launcher process
           └─2199 postgres: stats collector process

Dez 31 14:06:11 pg01.localdomain systemd[1]: Starting PostgreSQL 9.6 database server...
Dez 31 14:06:11 pg01.localdomain postmaster[2190]: < 2016-12-31 14:06:11.631 BRST > LOG:  redirecionando saída do log para processo coletor de log
Dez 31 14:06:11 pg01.localdomain postmaster[2190]: < 2016-12-31 14:06:11.631 BRST > DICA:  Saída futura do log aparecerá no diretório "pg_log".
Dez 31 14:06:11 pg01.localdomain systemd[1]: Started PostgreSQL 9.6 database server.
[ricardo@pg01 ~]$ su - postgres
Senha:
[ricardo@pg01 ~]$ sudo su - postgres
-bash-4.2$ psql
psql (9.6.1)
Digite "help" para ajuda.

postgres=# \q
-bash-4.2$

4 comments

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.