"Michael P. Soulier" <michael_soulier(at)mitel(dot)com> writes:
> I have an issue where a post-install script tries to create a database,
> and in 1 out of 10 cases I get this:
> "createdb: database creation failed: ERROR: source database "template1"
> is being accessed by other users"
Try inserting a short sleep before the createdb.
> Can createdb block until template1 is available?
For 8.3 we have
http://archives.postgresql.org/pgsql-committers/2007-06/msg00013.php
regards, tom lane