Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.4k 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!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...