DEV Community

Dmitry Romanoff
Dmitry Romanoff

Posted on

How do you check temporary file generation for each PostgreSQL DB on the Server?

To check the creation of temporary files for each DB on the PostgreSQL DB instance, run the following query:

select 
  stats_reset,
  datname, 
  temp_files, 
  pg_size_pretty(temp_bytes) as temp_file_size
from   
  pg_stat_database 
order by 
  temp_bytes desc;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)