Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

Is there any command to find all the databases size in Postgres?

I am able to find the size of a specific database by using following command:

select pg_database_size('databaseName');

1 Answer

0 votes
by (40.7k points)

If you want to use the complete query. You can use this:

\l+ <db_name>

You will get the size of the database as well as some details about the database.

To find the size of all the databases, use this code:

\l+

To query with the postgresql helper commands, You need to go into the postgresql command prompt

To Check other postgresql helper commands, use this syntax:

\?

at the postgresql command prompt.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Dec 16, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 31, 2019 in SQL by Tech4ever (20.3k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...