About Measuring the Size of PostgreSQL Database and its Tables
To check the size of a PostgreSQL database and its tables run the dbshell
management command:
$ python manage.py dbshell
Then execute these SQL commands:
> /* Show the size of the 'djangotricks' database */
> SELECT pg_size_pretty(pg_database_size('djangotricks'));
> /* List out database tables */
> \dt
> /* Show the size of the 'tricks_trick' database table */
> SELECT pg_size_pretty(pg_total_relation_size('tricks_trick'));
Tips and Tricks Dev Ops Optimization Maintenance Django 4.2 Django 3.2 Django 2.2 PostgreSQL
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.