1
I need to execute the query SELECT pg_database_size('mydatabase')
, how do I do this in Django
with the SGBD Postgres
?
This is what I’ve tried
from django.db import connection
cursor = connection.cursor()
size = cursor.execute('''SELECT pg_database_size("mydatabase")''')
But the result of size
is None
.
How do I execute this query? The intention is to return the size of the database.