cancel
Showing results for 
Search instead for 
Did you mean: 

pg_stat_statement failed

Silver Adventurer

pg_stat_statement failed

Hi All,

             After creation the pg_Stat_statement extention,failed to select.

If any one facing the iusse ,please send or advice.

 

thanks!!!

 

FYI,

afauat=# select * from pg_stat_statements ;
ERROR: pg_stat_statements must be loaded via shared_preload_libraries

4 REPLIES 4
EDB Team Member

Re: pg_stat_statement failed

Hi Din2pg,

 

Can you please share the output of the following command from your cluster.

 

show shared_preload_libraries;

EDB Team Member

Re: pg_stat_statement failed

Hello,

Hope you are doing good.

 

The pg_stat_statements module tracks execution statistics of all SQL statements executed by postgres server.

 

The module must be loaded by adding pg_stat_statements to shared_preload_libraries in postgresql.conf, because it requires additional shared memory.

 

This means that a server restart is needed to add or remove the module.

 

About error you are facing, It seems pg_stat_statements module was not set in shared_preload_libraries parameter.

 

Please set below configuration parameter in postgresql.conf and restart Database Server.

 

shared_preload_libraries = 'pg_stat_statements'

 

You can check here for more details.

https://www.postgresql.org/docs/10/pgstatstatements.html 

 

Please let us know if you face any issues still.

 

Regards
Siva.

 

Silver Adventurer

Re: pg_stat_statement failed

Hi @sivamekala 

afauat=# show shared_preload_libraries ;
shared_preload_libraries
---------------------------------------------------
$libdir/dbms_pipe,$libdir/edb_gen,$libdir/dbms_aq
(1 row)

afauat=#

 

Need to restart the Database cluster?

 

EDB Team Member

Re: pg_stat_statement failed

Hello,

 

Please add "pg_stat_statements" module to shared_preload_libraries parameter along with others($libdir/dbms_pipe,$libdir/edb_gen,$libdir/dbms_aq) and restart Database Cluster.

 

Ex: shared_preload_libraries = '$libdir/dbms_pipe,$libdir/edb_gen,$libdir/dbms_aq,$libdir/pg_stat_statements'

 

Please let us know if you face any issues still.

 

Regards
Siva.