psql command-line program is used to determine the sizes of PostgreSQL databases and tables.

Log in to your Hostginger hosting account.

Type the following command at the command line. Replace dbname with the name of the database, and username with the database username: 

psql dbname username

When you type the correct password at the PASSWORD prompt, the psql prompt appears.

The following command determines the size of a database. Replace dbname with the name of the database of which you want to determine the size:
SELECT pg_size_pretty( pg_database_size('dbname') );

To determine the size of a table in the database, type the following command. Replace tablename with the name of the table that you want to determine:
SELECT pg_size_pretty( pg_total_relation_size('tablename') );



 

 

 

Was this answer helpful? 0 Users Found This Useful (0 Votes) PostgreSQL