Let's say I run CREATE DATABASE abcd
, PostgreSQL will create an empty database and if I run SELECT pg_size_pretty(pg_database_size('abcd'));
, I get size of the database, let's say 8000kB. What I want to know is will the size of the empty database always be the same no matter what or does it depend? I specifically need to know if empty database size would change over time (create database 1 year from now) or if it would change over quantity (10000th database). I can't test for those cases and I couldn't find any information on that. Thank you.
Postgresql – Does PostgreSQL always initialize database of same size
database-designpostgresql
Related Question
- Postgresql – Proper storage size estimation technique for PostgreSQL
- Sql-server – Product quantity bound to colors and sizes table structures
- A simple question regarding database design that has always bothered me
- Postgresql – BIG Binary column – PostgreSQL 9.2
- How to Securely Initialize a PostgreSQL Database
- PostgreSQL – Reducing Table Size Bytes Per Row
Best Answer
Absolutely not. The database is formed from the contents of
template1
a "master database." Adding things totemplate1
will directly affect the contents of the new database.From the docs, Template Databases
However, you can create a copy of
template0
which we hope is a virgin database, also from the docs links above.