PostgreSQL: How to show database size

Posted Almost 2 years ago. Visible to the public.
SELECT pg_size_pretty(pg_database_size('some-database'));

Example

SELECT pg_size_pretty(pg_database_size('cards_p'));
----------------
 13 GB
(1 row)
SELECT pg_database_size('cards_p');
 pg_database_size 
------------------
      13524832927
(1 row)
Last edit
Almost 2 years ago
Emanuel
License
Source code in this card is licensed under the MIT License.
Posted by Emanuel to makandra dev (2022-07-06 13:07)