PostgreSQL Runbook — DjangoPlay Web
Project: DjangoPlay Web Document Type: Runbook Last Updated: 2026-03-28 Version: 1.0
On this page ▾
1. Overview
PostgreSQL is the primary database used by DjangoPlay Web.
2. Connect to Database
To connect to the PostgreSQL database:
bash
psql -U <user> -h <host> <database>
`3. Common Commands
List databases:
sql
\lList tables:
sql
\dtDescribe table:
sql
\d table_nameExit:
sql
\q4. Restart PostgreSQL
To restart PostgreSQL service:
bash
sudo systemctl restart postgresql5. Check Connections
To check current database connections:
sql
SELECT * FROM pg_stat_activity;6. Database Size
To check the size of a specific database:
sql
SELECT pg_size_pretty(pg_database_size('<database>'));Something wrong or missing on this page?Report a docs issue