Thread: error regarding creating a database

error regarding creating a database

From
siva kiran balijepalli
Date:
Hi everybody

i have a error while conencting to the database.

i am trying to creating a database from the client on a server
and it is reporting the following error..


This is the command
" create database siva_test with owner=siva"

error: source database "template1" is being accessed by other users



please help me regarding this

thanks & regards
sivakiran .B

Re: error regarding creating a database

From
Andreas Kretschmer
Date:
siva kiran balijepalli <b.sivakiran@gmail.com> wrote:

> Hi everybody
>
> i have a error while conencting to the database.
>
> i am trying to creating a database from the client on a server
> and it is reporting the following error..
>
>
> This is the command
> " create database siva_test with owner=siva"
>
> error: source database "template1" is being accessed by other users

There is, at least, one other user connected to the template-database
template1, and kept a transaction open. That's the reason, and that's
the solution ...


Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: error regarding creating a database

From
Grzegorz Szpetkowski
Date:
2011/5/2 siva kiran balijepalli <b.sivakiran@gmail.com>:
> Hi everybody
> i have a error while conencting to the database.
> i am trying to creating a database from the client on a server
> and it is reporting the following error..
>
> This is the command
> " create database siva_test with owner=siva"
> error: source database "template1" is being accessed by other users
>
>
> please help me regarding this
> thanks & regards
> sivakiran .B

If your template0 is same as template1 (probably it is), then you can also use:

create database siva_test with owner=siva template=template0

Regards
Grzegorz Szpetkowski