Skip site navigation (1) Skip section navigation (2)

Re: createdb fails

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Hamedany, Allen" <Allen(dot)Hamedany(at)revivio(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: createdb fails
Date: 2004-02-03 11:49:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

On Mon, 2 Feb 2004, Hamedany, Allen wrote:

> Running postgresql v7.3 on RH7.3 linux; db creation fails and is
> reproducible after a fresh image install. Any subsequent rebooting seems
> to work fine.
> We start up Postgres, create users and db using a Java (IBM1.4.1) class.
> The following commands are executed in the following order:
> /usr/local/pgsql/bin/pg_ctl -w start -D /var/lib/pgsql -l
> /var/log/pgsqld.log -o -i
> /usr/local/pgsql/bin/createdb management <-- fails here
> /usr/local/pgsql/bin/createdb test <-- fails here
> 2004-02-02 17:33:01 [1626]   LOG:  query: SET autocommit TO 'on';CREATE
> DATABASE "test"
> 2004-02-02 17:33:01 [1626]   ERROR:  CREATE DATABASE: source database
> "template1" is being accessed by other users

This is showing that the second createdb call is failing with the error
that there is an open connection to template1.  In your case I wonder if
even though the "createdb management" client has exited allowing the code
to proceed to "createdb test" call, the backend associated with this
connection may not have completely shut down yet.

What happens if you add a sleep 5 call in between the createdb calls?

Kris Jurka

In response to


pgsql-bugs by date

Next:From: Tom LaneDate: 2004-02-03 15:16:26
Subject: Re: createdb fails
Previous:From: Kris JurkaDate: 2004-02-03 08:12:43
Subject: Re: createdb fails

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group