Is there a way to speed up PostgreSQL's createdb command?
Normally I wouldn't care, but doing unit testing in Django creates a database every time, and it takes about 5 seconds.
I'm using openSUSE 11.2 64-bit, PostgreSQL 8.4.2
Is there a way to speed up PostgreSQL's createdb command?
Normally I wouldn't care, but doing unit testing in Django creates a database every time, and it takes about 5 seconds.
I'm using openSUSE 11.2 64-bit, PostgreSQL 8.4.2
DROP OWNED BY ... CASCADE
to drop all objects created by whichever user is configured in Django, bringing the database back to an essentially pristine condition. See how much faster this is.initdb
. See how much faster this is.It won't help you now, but there has been some work done around this in PostgreSQL 9.0.`
What you can try as a workaround is to run with fsync=off. Of course, don't even think about doing this if you have actual data in your database, but if it runs on a test system only, that will make your CREATE DATABASE run a lot faster.