pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Clay, Bruce <bclay@ball.com>
To: pgsql-interfaces@postgresql.org
Subject: Create database error template 1 busy
Date: Thu, 24 Mar 2005 12:03:47 -0500
Message-ID: <C482FF98AE985A47B8C982FD429C9E344F2528@daytonmsg2k3.AERO.BALL.COM> (raw)

Set new_b_flag = TRUE

 

------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------

Currently using PostgreSql 8.1 on a Windows XP precompiled release.

 

------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------

 

I am trying to create a data base with the following command going into
pqexec()

 

CREATE DATABASE \"World\" WITH OWNER = bclay"

       " ENCODING = 'UNICODE' TABLESPACE = gisData"

 

 

I always get the following error message:

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

 

There are no other users of this database since I am creating the GIS
database from scratch.

 

Based on comments I found on the net when others encountered the same
error message, I closed pgAdmin III to make sure it is not causing the
problem.

 

The next step in debugging I restarted pgAdmin III and tried the same
command there and got the same message.

 

pgAdmin III shows "template1" to be the initial database.

 

It turns out that the only way I can create a database is to specify
template0 in the Create Database call or use pgAdmin to create one that
can use template1.

 

------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------

 

Issue 2

 

Also, when I tried to add a comment while creaating the database using
the following string:

                        " COMMENT ON DATABASE \"World\" IS 'World GIS
Database'"

the create works but I the comment does not show up.

 

Is there a way to add a comment programmatically?

 

------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------

 

Issue 3

 

How to get database description?

 

1. I added a description filed using pgAdmin.  I can see the description
I added in pgAdmin when I click on the database name so I know it is
there.

 

2. If I issue the command < select * from pg_database > in pgAdmin query
I see all of the current databases but no description strings.

 

3. If I issue the command < select * from pg_description > in pgAdmin
query I see all of the descriptions that I added from pgAdmin but the
objoid is not the same as the oid that shows when I issued the < select
* from pg_database > command. So I can not select the correct
description.

 

Is there a way to go from any pg_database ID to a corresponding
pg_description ID to retrieve the correct description?

 

Bruce

 

 

Message-ID: <C482FF98AE985A47B8C982FD429C9E344F2528@daytonmsg2k3.AERO.BALL.COM>
Permalink:  ../C482FF98AE985A47B8C982FD429C9E344F2528@daytonmsg2k3.AERO.BALL.COM/
Also on:    postgresql.org/message-id/C482FF98AE985A47B8C982FD429C9E344F2528@daytonmsg2k3.AERO.BALL.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: bclay@ball.com
  Subject: Re: Create database error template 1 busy
  In-Reply-To: <C482FF98AE985A47B8C982FD429C9E344F2528@daytonmsg2k3.AERO.BALL.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox