How to determine the size of PostgreSQL databases?
Release : 16.0.2
To determine the size of a database:
Type the following command. Replace dbname with the name of the database that you want to check:
SELECT pg_size_pretty( pg_database_size('dbname') );
Psql displays the size of the database.