Re: createdb fails - Mailing list pgsql-bugs

From Kris Jurka
Subject Re: createdb fails
Date
Msg-id Pine.LNX.4.33.0402030646140.7921-100000@leary.csoft.net
Whole thread Raw
In response to createdb fails  ("Hamedany, Allen" <Allen.Hamedany@revivio.com>)
Responses Re: createdb fails
List 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

pgsql-bugs by date:

Previous
From: Kris Jurka
Date:
Subject: Re: createdb fails
Next
From: Tom Lane
Date:
Subject: Re: createdb fails