I'm using a hosted PostgreSQL database where I don't have shell access. Is there a query I can use to check the current WAL log size?
PostgreSQL – How to Check Current WAL Size in PostgreSQL 9.6
postgresqlpostgresql-9.6
postgresqlpostgresql-9.6
I'm using a hosted PostgreSQL database where I don't have shell access. Is there a query I can use to check the current WAL log size?
Best Answer
If you have superuser access, you can use:
which will return one row for each file in the directory
pg_xlog
. As the size for a WAL segment is fixed, you can easily calculate the total size by multiplying the number of rows by 16MB:Alternatively you can use
pg_stat_file()
to return information about the files:Starting with Postgres 10 you can use: