FATAL: could not access file “pg_stat_statements”: No such file or directory

Categorías:

 

Cuando se quiere iniciar un motor de postgresql se genera este error

FATAL: could not access file “pg_stat_statements”: No such file or directory

 

[root@repanalitica 10]# systemctl start postgresql.service 
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.
[root@repanalitica 10]# journalctl -xe
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql.service has begun starting up.
Aug 30 10:22:23 repanalitica.covinoc.local postgres[44814]: [1-1] 2023-08-30 10:22:23.573 -05 [44814] FATAL:  could not access file "pg_stat_statements": No such file or d>
Aug 30 10:22:23 repanalitica.covinoc.local postmaster[44814]: 2023-08-30 10:22:23.573 -05 [44814] FATAL:  could not access file "pg_stat_statements": No such file or direc>
Aug 30 10:22:23 repanalitica.covinoc.local postmaster[44814]: 2023-08-30 10:22:23.574 -05 [44814] LOG:  database system is shut down
Aug 30 10:22:23 repanalitica.covinoc.local postgres[44814]: [2-1] 2023-08-30 10:22:23.574 -05 [44814] LOG:  database system is shut down
Aug 30 10:22:23 repanalitica.covinoc.local systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Aug 30 10:22:23 repanalitica.covinoc.local systemd[1]: postgresql.service: Failed with result 'exit-code'.

Este error es debido a que no se ha instalado un paquete llamado postgresql-contrib, para solucionar este inconveniente instalamos el paquete mencionado.

 

[root@repanalitica 10]#  yum install postgresql-contrib
Failed to set locale, defaulting to C.UTF-8
Last metadata expiration check: 0:46:46 ago on Wed Aug 30 09:38:56 2023.
Dependencies resolved.
============================================================================================================================================================================
 Package                                   Architecture                  Version                                                     Repository                        Size
============================================================================================================================================================================
Installing:
 postgresql-contrib                        x86_64                        10.23-1.module+el8.7.0+1118+c6c6f44a                        appstream                        810 k
Installing dependencies:
 uuid                                      x86_64                        1.6.2-43.el8                                                appstream                         63 k

Transaction Summary
============================================================================================================================================================================
Install  2 Packages

Total download size: 873 k
Installed size: 2.7 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): uuid-1.6.2-43.el8.x86_64.rpm                                                                                                         100 kB/s |  63 kB     00:00    
(2/2): postgresql-contrib-10.23-1.module+el8.7.0+1118+c6c6f44a.x86_64.rpm                                                                   573 kB/s | 810 kB     00:01    
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                       477 kB/s | 873 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                    1/1 
  Installing       : uuid-1.6.2-43.el8.x86_64                                                                                                                           1/2 
  Running scriptlet: uuid-1.6.2-43.el8.x86_64                                                                                                                           1/2 
  Installing       : postgresql-contrib-10.23-1.module+el8.7.0+1118+c6c6f44a.x86_64                                                                                     2/2 
  Running scriptlet: postgresql-contrib-10.23-1.module+el8.7.0+1118+c6c6f44a.x86_64                                                                                     2/2 
  Verifying        : postgresql-contrib-10.23-1.module+el8.7.0+1118+c6c6f44a.x86_64                                                                                     1/2 
  Verifying        : uuid-1.6.2-43.el8.x86_64                                                                                                                           2/2 

Installed:
  postgresql-contrib-10.23-1.module+el8.7.0+1118+c6c6f44a.x86_64                                          uuid-1.6.2-43.el8.x86_64                                         

Complete!
[root@repanalitica 10]#

Luego de ello procedemos a iniciar el motor de postgresql

 

[root@repanalitica 10]# systemctl start postgresql.service 
[root@repanalitica 10]#

Y listo, problema resuelto.