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

Dmitry Romanoff - Nov 12 '23 - - Dev Community

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
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player