PostgreSQL La base de donnees la plus sophistiquee au monde.

Forums PostgreSQL.fr

Le forum officiel de la communauté francophone de PostgreSQL

Vous n'êtes pas identifié(e).

#1 Re : Général » problème de server » 17/02/2020 09:58:13

Bonjour,
ça n'a pas marché malheureusement, le serveur n'a pas voulu démarrer en plus quand j'ai voulu démarrer avec --single ça n'a pas marché:
[root@localhost ~]# su - postgres
Last login: Fri Feb 14 17:47:56 CET 2020 on pts/0
-bash-4.2$ psql
psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
-bash-4.2$ psql postgres
psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
-bash-4.2$ pg_ctl -D postgres restart
pg_ctl: directory "postgres" does not exist
-bash-4.2$ pg_ctl -D postgres start
pg_ctl: directory "postgres" does not exist
-bash-4.2$ postgres --single
2020-02-17 07:41:35.938 GMT [3999] LOG:  syntax error in file "/var/lib/pgsql/10/data/postgresql.conf" line 1, near token "-"
2020-02-17 07:41:35.938 GMT [3999] LOG:  syntax error in file "/var/lib/pgsql/10/data/postgresql.conf" line 437, near token "%"
2020-02-17 07:41:35.938 GMT [3999] FATAL:  configuration file "/var/lib/pgsql/10/data/postgresql.conf" contains errors
-bash-4.2$ cd $PGDATA
-bash-4.2$ vi postgresql.conf
-bash-4.2$ \q
bash: q: command not found...
-bash-4.2$ pg_ctl -D postgres restart
pg_ctl: directory "postgres" does not exist

==> le pire pg_ctl n'existe plus

#2 Re : Général » problème de server » 13/02/2020 17:39:10

comment savoir c'est quoi la syntaxe et comment rechercher la ligne 437 dans le fichier (je n'ai pas compris coment la corriger) merci

#3 Re : Général » problème de server » 13/02/2020 17:07:02

voilà ce que j'ai eu:
[root@localhost ~]# su -
Last login: Thu Feb 13 16:06:01 CET 2020 on pts/0
[root@localhost ~]# grep postgres /var/log/messages
Feb 10 10:40:15 localhost su: (to postgres) fares on pts/4
Feb 10 10:45:54 localhost su: (to postgres) fares on pts/4
Feb 10 10:46:12 localhost su: (to postgres) fares on pts/0
Feb 10 10:47:05 localhost su: (to postgres) fares on pts/0
Feb 10 10:49:16 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
Feb 10 10:51:44 localhost su: (to postgres) fares on pts/0
Feb 10 10:53:38 localhost su: (to postgres) fares on pts/0
Feb 10 10:55:19 localhost su: (to postgres) fares on pts/0
Feb 10 10:59:51 localhost su: (to postgres) fares on pts/1
Feb 10 12:31:15 localhost su: (to postgres) fares on pts/1
Feb 10 12:35:14 localhost su: (to postgres) fares on pts/0
Feb 10 12:35:48 localhost su: (to postgres) fares on pts/0
Feb 10 12:36:29 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 12:36:43 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 12:39:27 localhost su: (to postgres) fares on pts/2
Feb 10 12:47:28 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 12:48:18 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 12:48:31 localhost su: (to postgres) fares on pts/2
Feb 10 12:50:55 localhost su: FAILED SU (to postgres) fares on pts/0
Feb 10 12:52:18 localhost su: FAILED SU (to postgres) fares on pts/0
Feb 10 12:52:27 localhost su: FAILED SU (to postgres) fares on pts/0
Feb 10 12:53:10 localhost su: (to postgres) fares on pts/0
Feb 10 12:53:54 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 12:55:56 localhost su: (to postgres) fares on pts/2
Feb 10 14:45:14 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 14:45:25 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 14:46:00 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 14:46:17 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 14:47:31 localhost su: (to postgres) fares on pts/2
Feb 10 14:47:48 localhost su: FAILED SU (to postgres) fares on pts/2
Feb 10 14:54:17 localhost su: (to postgres) fares on pts/2
Feb 10 15:37:34 localhost su: (to postgres) fares on pts/0
Feb 10 16:57:13 localhost su: (to postgres) fares on pts/0
Feb 10 17:03:26 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 10 17:03:30 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 10 17:03:30 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 10 17:03:30 localhost systemd: postgresql-10.service failed.
Feb 10 17:10:52 localhost su: (to postgres) fares on pts/0
Feb 10 17:21:31 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 10 17:21:34 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 10 17:21:34 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 10 17:21:34 localhost systemd: postgresql-10.service failed.
Feb 10 17:22:34 localhost su: (to postgres) fares on pts/0
Feb 10 17:45:23 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 10 17:45:25 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 10 17:45:25 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 10 17:45:25 localhost systemd: postgresql-10.service failed.
Feb 10 17:49:27 localhost su: (to postgres) fares on pts/0
Feb 11 09:27:36 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 09:27:39 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 09:27:39 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 09:27:39 localhost systemd: postgresql-10.service failed.
Feb 11 09:31:12 localhost su: (to postgres) fares on pts/0
Feb 11 09:37:00 localhost su: (to postgres) fares on pts/0
Feb 11 10:11:57 localhost su: (to postgres) fares on pts/0
Feb 11 10:37:13 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 10:37:16 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 10:37:16 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 10:37:16 localhost systemd: postgresql-10.service failed.
Feb 11 10:39:25 localhost su: (to postgres) fares on pts/0
Feb 11 11:06:20 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 11:06:22 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 11:06:22 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 11:06:22 localhost systemd: postgresql-10.service failed.
Feb 11 11:54:04 localhost su: (to postgres) fares on pts/0
Feb 11 11:59:59 localhost su: (to postgres) fares on pts/0
Feb 11 12:01:50 localhost su: (to postgres) fares on pts/0
Feb 11 12:13:14 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 12:13:16 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 12:13:16 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 12:13:16 localhost systemd: postgresql-10.service failed.
Feb 11 12:24:26 localhost su: (to postgres) fares on pts/0
Feb 11 12:25:33 localhost su: (to postgres) fares on pts/0
Feb 11 12:27:06 localhost su: (to postgres) fares on pts/0
Feb 11 12:28:14 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
Feb 11 12:28:16 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 12:28:16 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 12:28:16 localhost systemd: postgresql-10.service failed.
Feb 11 12:30:01 localhost su: (to postgres) fares on pts/0
Feb 11 12:32:36 localhost su: (to postgres) fares on pts/0
Feb 11 14:17:27 localhost su: (to postgres) fares on pts/0
Feb 11 14:26:59 localhost su: (to postgres) fares on pts/0
Feb 11 14:46:28 localhost su: (to postgres) fares on pts/0
Feb 11 15:17:30 localhost su: (to postgres) fares on pts/0
Feb 11 15:29:03 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:29:06 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:29:06 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:29:06 localhost systemd: postgresql-10.service failed.
Feb 11 15:31:56 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:31:56 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:31:56 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:31:56 localhost systemd: postgresql-10.service failed.
Feb 11 15:33:19 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:33:21 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:33:21 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:33:21 localhost systemd: postgresql-10.service failed.
Feb 11 15:41:01 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:41:04 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:41:04 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:41:04 localhost systemd: postgresql-10.service failed.
Feb 11 15:44:36 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:44:38 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:44:38 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:44:38 localhost systemd: postgresql-10.service failed.
Feb 11 15:55:31 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:55:34 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:55:34 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:55:34 localhost systemd: postgresql-10.service failed.
Feb 11 15:59:45 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 15:59:45 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 15:59:45 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 15:59:45 localhost systemd: postgresql-10.service failed.
Feb 11 16:01:38 localhost su: (to postgres) fares on pts/0
Feb 11 16:08:15 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 16:08:15 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 16:08:15 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 16:08:15 localhost systemd: postgresql-10.service failed.
Feb 11 16:10:14 localhost su: (to postgres) fares on pts/0
Feb 11 16:58:33 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 16:58:33 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 16:58:33 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 16:58:33 localhost systemd: postgresql-10.service failed.
Feb 11 16:59:08 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 16:59:08 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 16:59:08 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 16:59:08 localhost systemd: postgresql-10.service failed.
Feb 11 17:00:41 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 17:00:44 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 17:00:44 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 17:00:44 localhost systemd: postgresql-10.service failed.
Feb 11 17:02:20 localhost su: (to postgres) fares on pts/0
Feb 11 17:04:58 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 11 17:04:59 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 17:04:59 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 11 17:04:59 localhost systemd: postgresql-10.service failed.
Feb 11 17:29:59 localhost su: (to postgres) fares on pts/0
Feb 13 09:49:37 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 13 09:49:46 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 13 09:49:46 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 13 09:49:46 localhost systemd: postgresql-10.service failed.
Feb 13 09:54:07 localhost su: (to postgres) fares on pts/0
Feb 13 10:44:57 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 13 10:44:59 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 13 10:44:59 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 13 10:44:59 localhost systemd: postgresql-10.service failed.
Feb 13 12:40:18 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 13 12:40:20 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 13 12:40:20 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 13 12:40:20 localhost systemd: postgresql-10.service failed.
Feb 13 12:42:03 localhost su: (to postgres) fares on pts/0
Feb 13 14:00:38 localhost postmaster: user=-database=-host==> DEBUG:      LOGNAME=postgres
Feb 13 14:00:38 localhost postmaster: user=-database=-host==> DEBUG:      USER=postgres
Feb 13 14:00:38 localhost postmaster: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
Feb 13 14:00:40 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 13 14:00:40 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 13 14:00:40 localhost systemd: postgresql-10.service failed.
Feb 13 14:02:47 localhost su: (to postgres) fares on pts/0
Feb 13 15:59:10 localhost postmaster: 2020-02-13 14:59:10.045 GMT [1587] LOG:  syntax error in file "/var/lib/pgsql/10/data/postgresql.conf" line 437, near token "%"
Feb 13 15:59:10 localhost postmaster: 2020-02-13 14:59:10.046 GMT [1587] FATAL:  configuration file "/var/lib/pgsql/10/data/postgresql.conf" contains errors
Feb 13 15:59:10 localhost systemd: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 13 15:59:10 localhost systemd: Unit postgresql-10.service entered failed state.
Feb 13 15:59:10 localhost systemd: postgresql-10.service failed.
Feb 13 16:03:50 localhost su: (to postgres) fares on pts/0

#4 Re : Général » problème de server » 13/02/2020 16:41:25

non je ne pense pas:
-bash-4.2$  df -h $PGDATA
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        97G  6.4G   91G   7% /

==> est-ce que mon .bash_profile est correct ?
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/10/data
export PGDATA

PGHOST=localhost
export PGHOST

PGPORT=5432
export PGPORT

PGDATABASE=gescom
export PGDATABASE

PGUSER=postgres
export PGUSER


PATH=$PATH:/usr/pgsql-10/bin
export PATH

est-ce qu'il manque un echo ou autre écriture ?

#5 Re : Général » problème de server » 13/02/2020 16:28:18

J'ai rajouté %m avant log_line et j'ai essayé de redémarrer regarde mon dernier poste

#6 Re : Général » problème de server » 13/02/2020 16:11:15

oui pifor j'ai fait ce que tu m'as dit toujours rien:
-bash-4.2$ pg_ctl -D $PGDATA restart
pg_ctl: PID file "/var/lib/pgsql/10/data/postmaster.pid" does not exist
Is server running?
starting server anyway
waiting for server to start....2020-02-13 14:07:24.698 GMT [5136] LOG:  syntax error in file "/var/lib/pgsql/10/data/postgresql.conf" line 437, near token "%"
2020-02-13 14:07:24.699 GMT [5136] FATAL:  configuration file "/var/lib/pgsql/10/data/postgresql.conf" contains errors
stopped waiting
pg_ctl: could not start server
Examine the log output.
-bash-4.2$ cd $PGDATA/log
-bash-4.2$ ll
total 72
-rw-------. 1 postgres postgres   277 Feb 10 09:16 postgresql-Fri.log
-rw-------. 1 postgres postgres 25916 Feb 10 17:50 postgresql-Mon.log
-rw-------. 1 postgres postgres  8019 Jan 20 12:31 postgresql-Sat.log
-rw-------. 1 postgres postgres  8967 Feb 13 14:00 postgresql-Thu.log
-rw-------. 1 postgres postgres 13524 Feb 11 17:31 postgresql-Tue.log
-rw-------. 1 postgres postgres   339 Feb  6 12:22 postgresql-Wed.log

voici le dernier log:
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53368
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:41:37.751 user=postgres database=gescom host=::1 port=53368
user=-database=-host==> LOG:  database system was interrupted; last known up at 2020-01-23 12:30:05 CET
user=-database=-host==> LOG:  starting archive recovery
user=-database=-host==> LOG:  restored log file "00000001000000000000000B" from archive
user=-database=-host==> LOG:  redo starts at 0/B000060
user=-database=-host==> LOG:  consistent recovery state reached at 0/B000168
user=-database=-host==> LOG:  database system is ready to accept read only connections
user=-database=-host==> LOG:  restored log file "00000001000000000000000C" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000D" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000E" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000F" from archive
cp: cannot stat ‘/archives/000000010000000000000010’: No such file or directory
user=-database=-host==> LOG:  redo done at 0/F000140
user=-database=-host==> LOG:  last completed transaction was at log time 2020-01-23 13:02:19.152364+01
user=-database=-host==> LOG:  restored log file "00000001000000000000000F" from archive
cp: cannot stat ‘/archives/00000002.history’: No such file or directory
user=-database=-host==> LOG:  selected new timeline ID: 2
user=-database=-host==> LOG:  archive recovery complete
cp: cannot stat ‘/archives/00000001.history’: No such file or directory
user=-database=-host==> LOG:  database system is ready to accept connections
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53371
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 90:53:20.744 user=postgres database=gescom host=::1 port=53371
user=-database=-host==> LOG:  database system was shut down at 2020-02-06 12:22:01 CET
user=-database=-host==> LOG:  database system is ready to accept connections
user=-database=-host==> LOG:  received fast shutdown request
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 4982) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down
user=-database=-host==> LOG:  database system was shut down at 2020-02-06 14:04:50 CET
user=-database=-host==> LOG:  database system is ready to accept connections

Merci aussi de vérifier si le contenu de mon $PGDATA est correct:
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/10/data
export PGDATA

PGHOST=localhost
export PGHOST

PGPORT=5432
export PGPORT

PGDATABASE=gescom
export PGDATABASE

PGUSER=postgres
export PGUSER


PATH=$PATH:/usr/pgsql-10/bin
export PATH

est-ce qu'il manque un echo ou autre écriture ?

#7 Re : Général » problème de server » 13/02/2020 15:27:20

Pour le fichier de configuration $PGDATA/postgresql.conf merci de trouver ci-dessous:
#------------------------------------------------------------------------------
# FILE LOCATIONS
#------------------------------------------------------------------------------

# The default values of these variables are driven from the -D command-line
# option or PGDATA environment variable, represented here as ConfigDir.

#data_directory = 'ConfigDir'           # use data in another directory
                                        # (change requires restart)
#hba_file = 'ConfigDir/pg_hba.conf'     # host-based authentication file
                                        # (change requires restart)
#ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
                                        # (change requires restart)

# If external_pid_file is not explicitly set, no extra PID file is written.
#external_pid_file = ''                 # write an extra PID file
                                        # (change requires restart)


#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

listen_addresses = '*'    # what IP address(es) to listen on;

                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                     # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
#unix_socket_directories = '/var/run/postgresql, /tmp'  # comma-separated list of directories
                                        # (change requires restart)
#unix_socket_group = ''                 # (change requires restart)
#unix_socket_permissions = 0777         # begin with 0 to use octal notation
                                        # (change requires restart)
#bonjour = off                          # advertise server via Bonjour
                                        # (change requires restart)
#bonjour_name = ''                      # defaults to the computer name
                                        # (change requires restart)

# - Security and Authentication -

#authentication_timeout = 1min          # 1s-600s
#ssl = off
#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers
#ssl_prefer_server_ciphers = on
#ssl_ecdh_curve = 'prime256v1'
#ssl_dh_params_file = ''
#ssl_cert_file = 'server.crt'
#ssl_key_file = 'server.key'
#ssl_ca_file = ''
#ssl_crl_file = ''
#password_encryption = md5              # md5 or scram-sha-256
#db_user_namespace = off
#row_security = on

# GSSAPI using Kerberos
#krb_server_keyfile = ''
#krb_caseins_users = off
# - TCP Keepalives -
# see "man 7 tcp" for details

#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_count = 0               # TCP_KEEPCNT;
                                        # 0 selects the system default


#------------------------------------------------------------------------------
# RESOURCE USAGE (except WAL)
#------------------------------------------------------------------------------

# - Memory -

shared_buffers = 256MB                  # min 128kB
                                        # (change requires restart)
#huge_pages = try                       # on, off, or try
                                        # (change requires restart)
temp_buffers = 8MB                      # min 800kB
#max_prepared_transactions = 0          # zero disables the feature
                                        # (change requires restart)
# Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
# per transaction slot, plus lock space (see max_locks_per_transaction).
# It is not advisable to set max_prepared_transactions nonzero unless you
#actively intend to use prepared transactions.
work_mem = 10MB                         # min 64kB
maintenance_work_mem = 100MB            # min 1MB
#replacement_sort_tuples = 150000       # limits use of replacement selection sort
#autovacuum_work_mem = -1               # min 1MB, or -1 to use maintenance_work_mem
#max_stack_depth = 2MB                  # min 100kB
dynamic_shared_memory_type = posix      # the default is the first option
                                        # supported by the operating system:
                                        #   posix
                                        #   sysv
                                        #   windows
                                        #   mmap
                                        # use none to disable dynamic shared memory
                                        # (change requires restart)

# - Disk -

#temp_file_limit = -1                   # limits per-process temp file space
                                        # in kB, or -1 for no limit

# - Kernel Resource Usage -

#max_files_per_process = 1000           # min 25
                                        # (change requires restart)
#shared_preload_libraries = ''          # (change requires restart)

# - Cost-Based Vacuum Delay -

#vacuum_cost_delay = 0                  # 0-100 milliseconds
#vacuum_cost_page_hit = 1               # 0-10000 credits
#vacuum_cost_page_miss = 10             # 0-10000 credits
#vacuum_cost_page_dirty = 20            # 0-10000 credits
#vacuum_cost_limit = 200                # 1-10000 credits
# - Background Writer -

#bgwriter_delay = 200ms                 # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100            # 0-1000 max buffers written/round
#bgwriter_lru_multiplier = 2.0          # 0-10.0 multiplier on buffers scanned/round
#bgwriter_flush_after = 512kB           # measured in pages, 0 disables

# - Asynchronous Behavior -

#effective_io_concurrency = 1           # 1-1000; 0 disables prefetching
#max_worker_processes = 8               # (change requires restart)
#max_parallel_workers_per_gather = 2    # taken from max_parallel_workers
#max_parallel_workers = 8               # maximum number of max_worker_processes that
                                        # can be used in parallel queries
#old_snapshot_threshold = -1            # 1min-60d; -1 disables; 0 is immediate
                                        # (change requires restart)
#backend_flush_after = 0                # measured in pages, 0 disables


#------------------------------------------------------------------------------
# WRITE AHEAD LOG
#------------------------------------------------------------------------------

# - Settings -

wal_level = archive                     # minimal, archive, or hot_standby
                                        # (change requires restart)
#fsync = on                             # flush data to disk for crash safety
                                        # (turning this off can cause
                                        # unrecoverable data corruption)
#synchronous_commit = on                # synchronization level;
                                        # off, local, remote_write, remote_apply, or on
#wal_sync_method = fsync                # the default is the first option
                                        # supported by the operating system:
                                        #   open_datasync
                                        #   fdatasync (default on Linux)
                                        #   fsync
                                        #   fsync_writethrough
                                        #   open_sync
#full_page_writes = on                  # recover from partial page writes
#wal_compression = off                  # enable compression of full-page writes
#wal_log_hints = off                    # also do full page writes of non-critical updates
                                        # (change requires restart)
#wal_buffers = -1                       # min 32kB, -1 sets based on shared_buffers
                                        # (change requires restart)
#wal_writer_delay = 200ms               # 1-10000 milliseconds
#wal_writer_flush_after = 1MB           # measured in pages, 0 disables

#commit_delay = 0                       # range 0-100000, in microseconds
#commit_siblings = 5                    # range 1-1000

# - Checkpoints -

#checkpoint_timeout = 5min              # range 30s-1d
#max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5     # checkpoint target duration, 0.0 - 1.0
#checkpoint_flush_after = 256kB         # measured in pages, 0 disables
#checkpoint_warning = 30s               # 0 disables

# - Archiving -

archive_mode = on               # enables archiving; off, on, or always
                                # (change requires restart)
archive_command = 'cp -i %p /archives/%f'               # command to use to archive a logfile segment
                                # placeholders: %p = path of file to archive
                                #               %f = file name only
                                # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'
#archive_timeout = 0            # force a logfile segment switch after this
                                # number of seconds; 0 disables


#------------------------------------------------------------------------------
# REPLICATION
#------------------------------------------------------------------------------

# - Sending Server(s) -

# Set these on the master and on any standby that will send replication data.

#max_wal_senders = 10           # max number of walsender processes
                                # (change requires restart)
#wal_keep_segments = 0          # in logfile segments, 16MB each; 0 disables
#wal_sender_timeout = 60s       # in milliseconds; 0 disables

#max_replication_slots = 10     # max number of replication slots
                                # (change requires restart)
#track_commit_timestamp = off   # collect timestamp of transaction commit
                                # (change requires restart)

# - Master Server -

# These settings are ignored on a standby server.

#synchronous_standby_names = '' # standby servers that provide sync rep
                                # method to choose sync standbys, number of sync standbys,

                                # and comma-separated list of application_name
                                # from standby(s); '*' = all
#vacuum_defer_cleanup_age = 0   # number of xacts by which cleanup is delayed

# - Standby Servers -

# These settings are ignored on a master server.

#hot_standby = on                       # "off" disallows queries during recovery
                                        # (change requires restart)
#max_standby_archive_delay = 30s        # max delay before canceling queries
                                        # when reading WAL from archive;
                                        # -1 allows indefinite delay
#max_standby_streaming_delay = 30s      # max delay before canceling queries
                                        # when reading streaming WAL;
                                        # -1 allows indefinite delay
#wal_receiver_status_interval = 10s     # send replies at least this often
                                        # 0 disables
#hot_standby_feedback = off             # send info from standby to prevent
                                        # query conflicts
#wal_receiver_timeout = 60s             # time that receiver waits for
                                        # communication from master
                                        # in milliseconds; 0 disables
#wal_retrieve_retry_interval = 5s       # time to wait before retrying to
                                        # retrieve WAL after a failed attempt

# - Subscribers -

# These settings are ignored on a publisher.

#max_logical_replication_workers = 4    # taken from max_worker_processes
                                        # (change requires restart)
#max_sync_workers_per_subscription = 2  # taken from max_logical_replication_workers
#------------------------------------------------------------------------------
# QUERY TUNING
#------------------------------------------------------------------------------

# - Planner Method Configuration -

#enable_bitmapscan = on
#enable_hashagg = on
#enable_hashjoin = on
#enable_indexscan = on
#enable_indexonlyscan = on
#enable_material = on
#enable_mergejoin = on
#enable_nestloop = on
#enable_seqscan = on
#enable_sort = on
#enable_tidscan = on

# - Planner Cost Constants -

#seq_page_cost = 1.0                    # measured on an arbitrary scale
#random_page_cost = 4.0                 # same scale as above
#cpu_tuple_cost = 0.01                  # same scale as above
#cpu_index_tuple_cost = 0.005           # same scale as above
#cpu_operator_cost = 0.0025             # same scale as above
#parallel_tuple_cost = 0.1              # same scale as above
#parallel_setup_cost = 1000.0   # same scale as above
#min_parallel_table_scan_size = 8MB
#min_parallel_index_scan_size = 512kB
#effective_cache_size = 4GB
# - Genetic Query Optimizer -

#geqo = on
#geqo_threshold = 12
#geqo_effort = 5                        # range 1-10
#geqo_pool_size = 0                     # selects default based on effort
#geqo_generations = 0                   # selects default based on effort
#geqo_selection_bias = 2.0              # range 1.5-2.0
#geqo_seed = 0.0                        # range 0.0-1.0

# - Other Planner Options -

#default_statistics_target = 100        # range 1-10000
#constraint_exclusion = partition       # on, off, or partition
#cursor_tuple_fraction = 0.1            # range 0.0-1.0
#from_collapse_limit = 8
#join_collapse_limit = 8                # 1 disables collapsing of explicit
                                        # JOIN clauses
#force_parallel_mode = off


#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------

# - Where to Log -

log_destination = 'stderr'              # Valid values are combinations of
                                        # stderr, csvlog, syslog, and eventlog,
                                        # depending on platform.  csvlog
                                        # requires logging_collector to be on.

# This is used when logging to stderr:
logging_collector = on                  # Enable capturing of stderr and csvlog
                                        # into log files. Required to be on for
                                        # csvlogs.
                                        # (change requires restart)

# These are only used if logging_collector is on:
log_directory = 'log'                   # directory where log files are written,
                                        # can be absolute or relative to PGDATA
log_filename = 'postgresql-%a.log'      # log file name pattern,
                                        # can include strftime() escapes
#log_file_mode = 0600                   # creation mode for log files,
                                        # begin with 0 to use octal notation
log_truncate_on_rotation = on           # If on, an existing log file with the
                                        # same name as the new log file will be
                                        # truncated rather than appended to.
                                        # But such truncation only occurs on
                                        # time-driven rotation, not on restarts
                                        # or size-driven rotation.  Default is
                                        # off, meaning append to existing files
                                        # in all cases.
log_rotation_age = 1d                   # Automatic rotation of logfiles will
                                        # happen after that time.  0 disables.
log_rotation_size = 0                   # Automatic rotation of logfiles will
                                        # happen after that much log output.
                                        # 0 disables.

# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#syslog_sequence_numbers = on
#syslog_split_messages = on

# This is only relevant when logging to eventlog (win32):
# (change requires restart)
#event_source = 'PostgreSQL'

# - When to Log -

log_min_messages = debug5               # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic

#log_min_error_statement = error        # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   info
                                        #   notice
                                        #   warning
                                        #   error
                                        #   log
                                        #   fatal
                                        #   panic (effectively off)
#log_min_duration_statement = 2000      # -1 is disabled, 0 logs all statements
                                        # and their durations, > 0 logs only
                                        # statements running at least this number
                                        # of milliseconds


# - What to Log -

#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = on
log_disconnections = on
#log_duration = off
#log_error_verbosity = default          # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = 'user=%u-database=%d-host=%h=> '              # special values:
                                        #   %a = application name
                                        #   %u = user name
                                        #   %d = database name
                                        #   %r = remote host and port
                                        #   %h = remote host
                                        #   %p = process ID
                                        #   %t = timestamp without milliseconds
                                        #   %m = timestamp with milliseconds
                                        #   %n = timestamp with milliseconds (as a Unix epoch)
                                        #   %i = command tag
                                        #   %e = SQL state
                                        #   %c = session ID
                                       #   %l = session line number
                                        #   %s = session start timestamp
                                        #   %v = virtual transaction ID
                                        #   %x = transaction ID (0 if none)
                                        #   %q = stop here in non-session
                                        #        processes
                                        #   %% = '%'
                                        # e.g. '<%u%%%d> '
#log_lock_waits = off                   # log lock waits >= deadlock_timeout
log_statement = 'ddl'                   # none, ddl, mod, all
#log_replication_commands = off
#log_temp_files = -1                    # log temporary files equal or larger
                                        # than the specified size in kilobytes;
                                        # -1 disables, 0 logs all temp files
log_timezone = 'Europe/Paris'


# - Process Title -

#cluster_name = ''                      # added to process titles if nonempty
                                        # (change requires restart)
#update_process_title = on


#------------------------------------------------------------------------------
# RUNTIME STATISTICS
#------------------------------------------------------------------------------

# - Query/Index Statistics Collector -

#track_activities = on
#track_counts = on
#track_io_timing = off
#track_functions = none                 # none, pl, all
#track_activity_query_size = 1024       # (change requires restart)
#stats_temp_directory = 'pg_stat_tmp'


# - Statistics Monitoring -

#log_parser_stats = off
#log_planner_stats = off
#log_executor_stats = off
#log_statement_stats = off


#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------

autovacuum = off                        # Enable autovacuum subprocess?  'on'
                                        # requires track_counts to also be on.
#log_autovacuum_min_duration = -1       # -1 disables, 0 logs all actions and
                                        # their durations, > 0 logs only
                                        # actions running at least this number
                                        # of milliseconds.
#autovacuum_max_workers = 3             # max number of autovacuum subprocesses
                                        # (change requires restart)
#autovacuum_naptime = 1min              # time between autovacuum runs
#autovacuum_vacuum_threshold = 50       # min number of row updates before
                                        # vacuum
#autovacuum_analyze_threshold = 50      # min number of row updates before
                                        # analyze
#autovacuum_vacuum_scale_factor = 0.2   # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1  # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000  # maximum XID age before forced vacuum
                                        # (change requires restart)
#autovacuum_multixact_freeze_max_age = 400000000        # maximum multixact age
                                        # before forced vacuum
                                        # (change requires restart)
#autovacuum_vacuum_cost_delay = 20ms    # default vacuum cost delay for
                                        # autovacuum, in milliseconds;
                                        # -1 means use vacuum_cost_delay
#autovacuum_vacuum_cost_limit = -1      # default vacuum cost limit for
                                        # autovacuum, -1 means use
                                        # vacuum_cost_limit


#------------------------------------------------------------------------------
# CLIENT CONNECTION DEFAULTS
#------------------------------------------------------------------------------

# - Statement Behavior -

#client_min_messages = notice           # values in order of decreasing detail:
                                        #   debug5
                                        #   debug4
                                        #   debug3
                                        #   debug2
                                        #   debug1
                                        #   log
                                        #   notice
                                        #   warning
                                        #   error
#search_path = '"$user", public'        # schema names
#default_tablespace = ''                # a tablespace name, '' uses the default
#temp_tablespaces = ''                  # a list of tablespace names, '' uses
                                        # only default tablespace
#check_function_bodies = on
#default_transaction_isolation = 'read committed'
#default_transaction_read_only = off
#default_transaction_deferrable = off
#session_replication_role = 'origin'
#statement_timeout = 0                  # in milliseconds, 0 is disabled
#lock_timeout = 0                       # in milliseconds, 0 is disabled
#idle_in_transaction_session_timeout = 0        # in milliseconds, 0 is disabled
#vacuum_freeze_min_age = 50000000
#vacuum_freeze_table_age = 150000000
#vacuum_multixact_freeze_min_age = 5000000
#vacuum_multixact_freeze_table_age = 150000000
#bytea_output = 'hex'                   # hex, escape
#xmlbinary = 'base64'
#xmloption = 'content'
#gin_fuzzy_search_limit = 0
#gin_pending_list_limit = 4MB

# - Locale and Formatting -

datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'Europe/Paris'
#timezone_abbreviations = 'Default'     # Select the set of available time zone
                                        # abbreviations.  Currently, there are
                                        #   Default
                                        #   Australia (historical usage)
                                        #   India
                                        # You can create your own file in
                                        # share/timezonesets/.
#extra_float_digits = 0                 # min -15, max 3
#client_encoding = sql_ascii            # actually, defaults to database
                                        # encoding

# These settings are initialized by initdb, but they can be changed.
lc_messages = 'en_US.UTF-8'                     # locale for system error message
                                        # strings
lc_monetary = 'en_US.UTF-8'                     # locale for monetary formatting
lc_numeric = 'en_US.UTF-8'                      # locale for number formatting
lc_time = 'en_US.UTF-8'                         # locale for time formatting

# default configuration for text search
default_text_search_config = 'pg_catalog.english'

# - Other Defaults -

#dynamic_library_path = '$libdir'
#local_preload_libraries = ''
#session_preload_libraries = ''


#------------------------------------------------------------------------------
# LOCK MANAGEMENT
#------------------------------------------------------------------------------

#deadlock_timeout = 1s
#max_locks_per_transaction = 64         # min 10
                                        # (change requires restart)
#max_pred_locks_per_transaction = 64    # min 10
                                        # (change requires restart)
#max_pred_locks_per_relation = -2       # negative values mean
                                        # (max_pred_locks_per_transaction
                                        #  / -max_pred_locks_per_relation) - 1
#max_pred_locks_per_page = 2            # min 0


#------------------------------------------------------------------------------
# VERSION/PLATFORM COMPATIBILITY
#------------------------------------------------------------------------------

# - Previous PostgreSQL Versions -

#array_nulls = on
#backslash_quote = safe_encoding        # on, off, or safe_encoding
#default_with_oids = off
#escape_string_warning = on
#lo_compat_privileges = off
#operator_precedence_warning = off
#quote_all_identifiers = off
#standard_conforming_strings = on
#synchronize_seqscans = on

# - Other Platforms and Clients -

#transform_null_equals = off


#------------------------------------------------------------------------------
# ERROR HANDLING
#------------------------------------------------------------------------------

#exit_on_error = off                    # terminate session on any error?
#restart_after_crash = on               # reinitialize after backend crash?
#data_sync_retry = off                  # retry or panic on failure to fsync
                                        # data?
                                        # (change requires restart)


#------------------------------------------------------------------------------
# CONFIG FILE INCLUDES
#------------------------------------------------------------------------------

# These options allow settings to be loaded from files other than the
# default postgresql.conf.  Note that these are directives, not variable
# assignments, so they can usefully be given more than once.

#include_dir = '...'                    # include files ending in '.conf' from
                                        # a directory, e.g., 'conf.d'
#include_if_exists = '...'              # include file only if it exists
#include = '...'                        # include file


#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------

# Add settings for extensions here

le dernier log $PGDATA/log:
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53368
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:41:37.751 user=postgres database=gescom host=::1 port=53368
user=-database=-host==> LOG:  database system was interrupted; last known up at 2020-01-23 12:30:05 CET
user=-database=-host==> LOG:  starting archive recovery
user=-database=-host==> LOG:  restored log file "00000001000000000000000B" from archive
user=-database=-host==> LOG:  redo starts at 0/B000060
user=-database=-host==> LOG:  consistent recovery state reached at 0/B000168
user=-database=-host==> LOG:  database system is ready to accept read only connections
user=-database=-host==> LOG:  restored log file "00000001000000000000000C" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000D" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000E" from archive
user=-database=-host==> LOG:  restored log file "00000001000000000000000F" from archive
cp: cannot stat ‘/archives/000000010000000000000010’: No such file or directory
user=-database=-host==> LOG:  redo done at 0/F000140
user=-database=-host==> LOG:  last completed transaction was at log time 2020-01-23 13:02:19.152364+01
user=-database=-host==> LOG:  restored log file "00000001000000000000000F" from archive
cp: cannot stat ‘/archives/00000002.history’: No such file or directory
user=-database=-host==> LOG:  selected new timeline ID: 2
user=-database=-host==> LOG:  archive recovery complete
cp: cannot stat ‘/archives/00000001.history’: No such file or directory
user=-database=-host==> LOG:  database system is ready to accept connections
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53371
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 90:53:20.744 user=postgres database=gescom host=::1 port=53371
user=-database=-host==> LOG:  database system was shut down at 2020-02-06 12:22:01 CET
user=-database=-host==> LOG:  database system is ready to accept connections
user=-database=-host==> LOG:  received fast shutdown request
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 4982) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down
user=-database=-host==> LOG:  database system was shut down at 2020-02-06 14:04:50 CET
user=-database=-host==> LOG:  database system is ready to accept connections

celui de mardi 11 février:
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53381
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  statement: create table voitures (num int);
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:54:28.758 user=postgres database=gescom host=::1 port=53381
user=-database=-host==> LOG:  received fast shutdown request
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 72998) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down
user=-database=-host==> LOG:  database system was shut down at 2020-01-28 17:36:50 CET
user=-database=-host==> LOG:  database system is ready to accept connections
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53382
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  statement: drop table voitures;
user=postgres-database=gescom-host=::1=> LOG:  statement: create table voitures (num int);
user=postgres-database=gescom-host=::1=> ERROR:  syntax error at or near ";" at character 55
user=postgres-database=gescom-host=::1=> STATEMENT:  insert into voitures values(generate_series(1,1000000);
        insert into voitures values (generate_series(1,1000000));
        )
        ;
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:08:36.449 user=postgres database=gescom host=::1 port=53382
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53383
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:00:03.323 user=postgres database=gescom host=::1 port=53383
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53384
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 210:18:18.004 user=postgres database=gescom host=::1 port=53384
user=-database=-host==> LOG:  invalid connection type "Allow"
user=-database=-host==> CONTEXT:  line 85 of configuration file "/var/lib/pgsql/10/data/pg_hba.conf"
user=-database=-host==> LOG:  invalid connection type "replication"
user=-database=-host==> CONTEXT:  line 86 of configuration file "/var/lib/pgsql/10/data/pg_hba.conf"
user=-database=-host==> FATAL:  could not load pg_hba.conf
user=-database=-host==> LOG:  database system is shut down
user=-database=-host==> LOG:  invalid connection type "Allow"
"postgresql-Tue.log" 177L, 13524C

celui du vendredi dernier 11 fevrier:
user=-database=-host==> LOG:  database system was shut down at 2020-01-20 12:31:07 CET
user=-database=-host==> LOG:  database system is ready to accept connections
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53306
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=postgres-database=gescom-host=::1=> ERROR:  syntax error at or near "'jean'" at character 13
user=postgres-database=gescom-host=::1=> STATEMENT:  create role 'jean' login password '123';
user=postgres-database=gescom-host=::1=> LOG:  statement: create role jean login password '123';
user=postgres-database=gescom-host=::1=> LOG:  statement: create role pascal login password '123';
user=postgres-database=gescom-host=::1=> LOG:  statement: create role admstock;
user=postgres-database=gescom-host=::1=> LOG:  statement: grant admstock to jean, pascal;
user=postgres-database=gescom-host=::1=> LOG:  statement: grant select on fact.categories to admstock;
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53307
user=jean-database=gescom-host=::1=> LOG:  connection authorized: user=jean database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 2:25:33.833 user=postgres database=gescom host=::1 port=53306
user=jean-database=gescom-host=::1=> LOG:  disconnection: session time: 0:00:22.443 user=jean database=gescom host=::1 port=53307
user=-database=-host==> LOG:  received fast shutdown request
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 121467) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down
user=-database=-host==> LOG:  database system was shut down at 2020-01-20 14:57:13 CET
user=-database=-host==> LOG:  database system is ready to accept connections
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53308
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53309
user=jean-database=gescom-host=::1=> LOG:  connection authorized: user=jean database=gescom
user=postgres-database=gescom-host=::1=> LOG:  disconnection: session time: 0:00:09.614 user=postgres database=gescom host=::1 port=53308
user=jean-database=gescom-host=::1=> ERROR:  permission denied for schema fact at character 15
user=jean-database=gescom-host=::1=> STATEMENT:  select * from fact.categories;
user=[unknown]-database=[unknown]-host=::1=> LOG:  connection received: host=::1 port=53310
user=postgres-database=gescom-host=::1=> LOG:  connection authorized: user=postgres database=gescom
user=jean-database=gescom-host=::1=> LOG:  disconnection: session time: 0:00:49.375 user=jean database=gescom host=::1 port=53309
user=postgres-database=gescom-host=::1=> LOG:  statement: grant usage on schema stagiaire to admstock;
user=postgres-database=gescom-host=::1=> ERROR:  schema "stagiaire" does not exist
"postgresql-Mon.log" 308L, 25916C

vendredi dernier aussi:
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 16514) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down

Je rajoute le .bash_profile où j'ai configuré $PGDATA et le PATH:
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/10/data
export PGDATA

PGHOST=localhost
export PGHOST

PGPORT=5432
export PGPORT

PGDATABASE=gescom
export PGDATABASE

PGUSER=postgres
export PGUSER


PATH=$PATH:/usr/pgsql-10/bin
export PATH

Merci beaucoup

#8 Re : Général » problème de server » 13/02/2020 13:48:37

rebonjour,
dans $PGDATA/postgresql.conf:
j'ai trouvé log_min_messages = warning et commenté je l'ai modifié comme tu m'as indiqué.

voici ce qu'il y a dans $PGDATA:
[ -f /etc/profile ] && source /etc/profile
PGDATA=/var/lib/pgsql/10/data
export PGDATA

PGHOST=localhost
export PGHOST

PGPORT=5432
export PGPORT

PGDATABASE=gescom
export PGDATABASE

PGUSER=postgres
export PGUSER


PATH=$PATH:/usr/pgsql-10/bin
export PATH

voici ce que postgresql m'a affiché quand j'ai executé pg_ctl start:
-bash-4.2$ pg_ctl start
waiting for server to start....user=-database=-host==> DEBUG:  postgres: PostmasterMain: initial environment dump:
user=-database=-host==> DEBUG:  -----------------------------------------
user=-database=-host==> DEBUG:      XDG_VTNR=1
user=-database=-host==> DEBUG:      XDG_SESSION_ID=1
user=-database=-host==> DEBUG:      HOSTNAME=localhost.localdomain
user=-database=-host==> DEBUG:      TERM=xterm-256color
user=-database=-host==> DEBUG:      SHELL=/bin/bash
user=-database=-host==> DEBUG:      HISTSIZE=1000
user=-database=-host==> DEBUG:      PG_GRANDPARENT_PID=3857
user=-database=-host==> DEBUG:      USER=postgres
user=-database=-host==> DEBUG:      LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
user=-database=-host==> DEBUG:      PGPORT=5432
user=-database=-host==> DEBUG:      PGUSER=postgres
user=-database=-host==> DEBUG:      PGDATABASE=gescom
user=-database=-host==> DEBUG:      PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/pgsql-10/bin
user=-database=-host==> DEBUG:      MAIL=/var/spool/mail/postgres
user=-database=-host==> DEBUG:      _=/usr/pgsql-10/bin/pg_ctl
user=-database=-host==> DEBUG:      PWD=/var/lib/pgsql
user=-database=-host==> DEBUG:      PGLOCALEDIR=/usr/pgsql-10/share/locale
user=-database=-host==> DEBUG:      LANG=en_US.UTF-8
user=-database=-host==> DEBUG:      PGHOST=localhost
user=-database=-host==> DEBUG:      PGSYSCONFDIR=/etc/sysconfig/pgsql
user=-database=-host==> DEBUG:      HISTCONTROL=ignoredups
user=-database=-host==> DEBUG:      HOME=/var/lib/pgsql
user=-database=-host==> DEBUG:      XDG_SEAT=seat0
user=-database=-host==> DEBUG:      SHLVL=1
user=-database=-host==> DEBUG:      LOGNAME=postgres
user=-database=-host==> DEBUG:      LESSOPEN=||/usr/bin/lesspipe.sh %s
user=-database=-host==> DEBUG:      PGDATA=/var/lib/pgsql/10/data
user=-database=-host==> DEBUG:      LC_COLLATE=en_US.UTF-8
user=-database=-host==> DEBUG:      LC_CTYPE=en_US.UTF-8
user=-database=-host==> DEBUG:      LC_MESSAGES=en_US.UTF-8
user=-database=-host==> DEBUG:      LC_MONETARY=C
user=-database=-host==> DEBUG:      LC_NUMERIC=C
user=-database=-host==> DEBUG:      LC_TIME=C
user=-database=-host==> DEBUG:  -----------------------------------------
user=-database=-host==> DEBUG:  registering background worker "logical replication launcher"
user=-database=-host==> LOG:  listening on IPv4 address "0.0.0.0", port 5432
user=-database=-host==> LOG:  listening on IPv6 address "::", port 5432
user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
user=-database=-host==> LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
user=-database=-host==> DEBUG:  invoking IpcMemoryCreate(size=290643968)
user=-database=-host==> DEBUG:  mmap(291504128) with MAP_HUGETLB failed, huge pages disabled: Cannot allocate memory
user=-database=-host==> DEBUG:  SlruScanDirectory invoking callback on pg_notify/0000
user=-database=-host==> DEBUG:  removing file "pg_notify/0000"
user=-database=-host==> DEBUG:  dynamic shared memory system will support 288 segments
user=-database=-host==> DEBUG:  created dynamic shared memory control segment 965091855 (6928 bytes)
user=-database=-host==> DEBUG:  max_safe_fds = 983, usable_fds = 1000, already_open = 7
user=-database=-host==> LOG:  redirecting log output to logging collector process
user=-database=-host==> HINT:  Future log output will appear in directory "log".
user=-database=-host==> DEBUG:  logger shutting down
user=-database=-host==> DEBUG:  shmem_exit(0): 0 before_shmem_exit callbacks to make
user=-database=-host==> DEBUG:  shmem_exit(0): 0 on_shmem_exit callbacks to make
user=-database=-host==> DEBUG:  proc_exit(0): 0 callbacks to make
user=-database=-host==> DEBUG:  exit(0)
user=-database=-host==> DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
user=-database=-host==> DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
user=-database=-host==> DEBUG:  proc_exit(-1): 0 callbacks to make
stopped waiting
pg_ctl: could not start server
Examine the log output.

ça ne marche toujours pas, est-ce que tu peux m'aider stp et merci d'avance.

#9 Re : Général » problème de server » 13/02/2020 11:02:51

Rebonjour,
désolé pour le retard,
Pifor dans le dernier $PGDATA/log il y avait ça:
user=-database=-host==> LOG:  received fast shutdown request
user=-database=-host==> LOG:  aborting any active transactions
user=-database=-host==> LOG:  worker process: logical replication launcher (PID 129816) exited with exit code 1
user=-database=-host==> LOG:  shutting down
user=-database=-host==> LOG:  database system is shut down

Le résultat de la commande ls -al /var/lib/pgsql/10/data:
drwx------. 20 postgres postgres  4096 Feb 13 09:49 .
drwx------.  4 postgres postgres    48 Dec 10 12:03 ..
-rw-------.  1 postgres postgres   202 Jan 23 12:30 backup_label.old
drwx------. 10 postgres postgres  4096 Jan 27 11:24 base
-rw-------.  1 postgres postgres    30 Feb 13 09:49 current_logfiles
drwx------.  2 postgres postgres  4096 Feb 10 12:53 global
-rw-------.  1 postgres postgres   482 Feb 11 10:46 journaux_trace
drwx------.  2 postgres postgres  4096 Feb 13 09:58 log
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_commit_ts
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_dynshmem
-rw-------.  1 postgres postgres  4267 Feb 11 09:41 pg_hba.conf
-rw-------.  1 postgres postgres  1636 Dec 10 12:03 pg_ident.conf
drwx------.  4 postgres postgres    65 Feb 10 14:44 pg_logical
drwx------.  4 postgres postgres    34 Dec 10 12:03 pg_multixact
drwx------.  2 postgres postgres    17 Feb 13 09:49 pg_notify
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_replslot
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_serial
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_snapshots
drwx------.  2 postgres postgres    80 Feb 10 14:44 pg_stat
drwx------.  2 postgres postgres     6 Feb  6 12:22 pg_stat_tmp
drwx------.  2 postgres postgres    17 Dec 10 12:03 pg_subtrans
drwx------.  2 postgres postgres    42 Jan 27 11:36 pg_tblspc
drwx------.  2 postgres postgres     6 Dec 10 12:03 pg_twophase
-rw-------.  1 postgres postgres     3 Dec 10 12:03 PG_VERSION
drwx------.  3 postgres postgres  4096 Feb 10 12:58 pg_wal
drwx------.  2 postgres postgres    17 Dec 10 12:03 pg_xact
-rw-------.  1 postgres postgres    88 Dec 10 12:03 postgresql.auto.conf
-rw-------.  1 postgres postgres 23156 Feb 11 14:22 postgresql.conf
-rw-------.  1 postgres postgres    58 Feb 13 09:49 postmaster.opts
-rw-r--r--.  1 postgres postgres    39 Jan 23 15:34 recovery.done
-rw-------.  1 postgres postgres    35 Jan 23 12:30 tablespace_map.old

==> mon problème c'est le fichier postmaster.pid qui n'est plus dans cette liste et qui est normalement doit être là pour les besoins du démarrage.
en fait depuis le début du probème il n'est pas là mais quand je le cherche avec la commande locate je le trouve dans cette arborescence mais il est absent de la liste ce-dessous. je l'ai killé ce qui est déconseillé je l'ai supprimé mais je suis en formation donc je ne travaille pas dans une entreprise. Alors svp je sollicite votre aide je suis effondré.

#10 Général » problème de server » 11/02/2020 18:38:33

TRUSSARDI
Réponses : 22

Bonjour,
Je suis pour la première fois ici. je travaille sur une machine vmware sur centos avec comme programme postgresql10 sous linux. En fait j'ai eu un problème sur le fichier postmaster.pid puis ça encore pris de l'ampleur puisque je ne peux plus me connecter au serveur.

message d'erreur 1: (je veux me connetcer à ma base)
[root@localhost ~]# su - postgres
Last login: Tue Feb 11 17:02:20 CET 2020 on pts/0
-bash-4.2$ psql
psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

message d'erreur 2: (je veux redemarrer mon instance)
[root@localhost ~]# su - postgres
Last login: Tue Feb 11 17:02:20 CET 2020 on pts/0
-bash-4.2$ psql
psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
-bash-4.2$ pg_ctl -D $PGDATA restart
pg_ctl: PID file "/var/lib/pgsql/10/data/postmaster.pid" does not exist
Is server running?
starting server anyway
waiting for server to start....user=-database=-host==> LOG:  listening on IPv4 address "0.0.0.0", port 5432
user=-database=-host==> LOG:  listening on IPv6 address "::", port 5432
user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
user=-database=-host==> LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
user=-database=-host==> LOG:  redirecting log output to logging collector process
user=-database=-host==> HINT:  Future log output will appear in directory "log".
stopped waiting
pg_ctl: could not start server
Examine the log output.



message d'erreur3:
[root@localhost ~]# systemctl start postgresql-10
Job for postgresql-10.service failed because the control process exited with error code. See "systemctl status postgresql-10.service" and "journalctl -xe" for details.
[root@localhost ~]#  systemctl status postgresql-10
● postgresql-10.service - PostgreSQL 10 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-10.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2020-02-11 17:04:59 CET; 30s ago
     Docs: https://www.postgresql.org/docs/10/static/
  Process: 4130 ExecStart=/usr/pgsql-10/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
  Process: 4120 ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 4130 (code=exited, status=1/FAILURE)

Feb 11 17:04:58 localhost.localdomain systemd[1]: Starting PostgreSQL 10 database server...
Feb 11 17:04:58 localhost.localdomain postmaster[4130]: user=-database=-host==> LOG:  listening on IPv4 address "0.0.0.0", port 5432
Feb 11 17:04:58 localhost.localdomain postmaster[4130]: user=-database=-host==> LOG:  listening on IPv6 address "::", port 5432
Feb 11 17:04:58 localhost.localdomain postmaster[4130]: user=-database=-host==> LOG:  listening on Unix socket "/var/run/postgresql....5432"
Feb 11 17:04:58 localhost.localdomain postmaster[4130]: user=-database=-host==> LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
Feb 11 17:04:59 localhost.localdomain systemd[1]: postgresql-10.service: main process exited, code=exited, status=1/FAILURE
Feb 11 17:04:59 localhost.localdomain systemd[1]: Failed to start PostgreSQL 10 database server.
Feb 11 17:04:59 localhost.localdomain systemd[1]: Unit postgresql-10.service entered failed state.
Feb 11 17:04:59 localhost.localdomain systemd[1]: postgresql-10.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Merci pour votre aide je suis vraiment mal surtout que je ne veux pas perdre des données

Pied de page des forums

Propulsé par FluxBB