Query to get the number of errors reported by PostgreSQL Is there any internal table recording the number of errors produced by Postgres?

I was expecting something like:

select 
    database, count(*) 
from 
    pg_errors 
where 
    type='error' and date &gt; (now() - INTERVAL '1 HOUR')
This is not tracked inside the database.

You could mine the log file for ERROR entries &mdash; log_destination = 'csvlog' will make it easier.

One option to process csvlogs (thanks, a_horse_with_no_name!) is to use them with a file_fdw foreign table to access them with SQL from PostgreSQL.