Tag: PostgreSQL
Backup script for PostgreSQL with zip support (Windows)
Simplest solution for backing up PostgreSQL databases. With this bat file you can dump one database to a file and compress it using 7-zip. PS. If you want a date in your filename simply add %date% var to it’s string. PS2. Of course check your paths before complaining it does not work 😛 @echo off […]
How to list all PostgreSQL databases and their sizes in MB
You must provide proper database name and user: File: gistfile1.txt ——————- psql -c “SELECT pg_database.datname, pg_database_size(pg_database.datname), pg_size_pretty(pg_database_size(pg_database.datname)) FROM pg_database ORDER BY pg_database_size DESC;” -d