pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgAdmin II questions
4+ messages / 4 participants
[nested] [flat]

* pgAdmin II questions
@ 2003-03-30 18:33  Tamir Halperin <tamir@brobus.net>
  0 siblings, 2 replies; 4+ messages in thread

From: Tamir Halperin @ 2003-03-30 18:33 UTC (permalink / raw)
  To: pgsql-admin

I just finished upgrading from FreeBSD 4.6 to 4.8RC and I'm trying to do some things with pgAdmin II which are giving me problems.

I remember creating a db called taxcal and it's listed there. However, I don't remember creating a db called pgsql.

Is this a db that the postgresql needs or was it created by mistake, maybe as a result of an erroneous create command?

Also, I can't drop it (by right clicking on it and selecting drop object from the shortcut menu. After being warned that the action cannot be undone I agree and an error comes up:

"An error as occured in pgAdmin II:basActions.drop:

Number: -2147467259
Description: ERROR: DROP DATABASE: database "pgsql" is being accessed by other users

Another thing I need help with is the appearance of both "template0" as well as "template1". I can't seem to delete template0 because the error from the drop action informs me that it is marked as a template.




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgAdmin II questions
@ 2003-03-30 20:21  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Tamir Halperin <tamir@brobus.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Stephan Szabo @ 2003-03-30 20:21 UTC (permalink / raw)
  To: Tamir Halperin <tamir@brobus.net>; +Cc: pgsql-admin


I don't know much about pgAdmin itself, but...

On Sun, 30 Mar 2003, Tamir Halperin wrote:

> I remember creating a db called taxcal and it's listed there. However,
> I don't remember creating a db called pgsql.

It's possible it got created as a side effect of the system upgrade.

> Also, I can't drop it (by right clicking on it and selecting drop
> object from the shortcut menu. After being warned that the action
> cannot be undone I agree and an error comes up:
>
> "An error as occured in pgAdmin II:basActions.drop:
>
> Number: -2147467259

> Description: ERROR: DROP DATABASE: database "pgsql" is being accessed
> by other users

Are there any connections to it on the server?  You can check with ps.

> Another thing I need help with is the appearance of both "template0"
> as well as "template1". I can't seem to delete template0 because the
> error from the drop action informs me that it is marked as a template.

Deleting template0 or template1 (unless you're just going to recreate it
from template0) is a bad idea.  They're the template databases from which
new databases are created (IIRC, template0 is just system things and
template1 can include anything you want to be clone in newly created
databases - such as language handlers, or wahtever).




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgAdmin II questions
@ 2003-03-31 14:56  Andrew Biagioni <andrew.biagioni@e-greek.net>
  parent: Stephan Szabo <sszabo@megazone23.bigpanda.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Andrew Biagioni @ 2003-03-31 14:56 UTC (permalink / raw)
  To: Tamir Halperin <tamir@brobus.net>; Stephan Szabo <sszabo@megazone23.bigpanda.com>; +Cc: pgsql-admin

I have considerable experience with PGAdmin.  I haven't seen a db called 
"pgsql", but then I use Linux.

Template DBs are used when creating other databases (see details on CREATE 
DATABASE command in doc.);  they are DBs marked as "templates" to prevent users 
from altering them, and that of course includes preventing deletion.  
"template0" is the pre-installed template which comes with a new data space, 
and cannot be edited/removed.  "template1" is the default, editable template, 
which you are supposed to customize to match the requirements you will have for 
all new DBs you create (for example, you can specify the encoding, add some 
default tables/functions/etc. that will be created in every new DB you create, 
unless you specify a different source template).

PGAdmin has a "logic" flaw when trying to drop DBs:  it accesses them when you 
click them to drop them, and in so doing they are marked by PostgreSQL as being 
"in use".  Result:  to delete them, you mark them as "in use";  marking them 
"in use" prevents their deletion.  This is similar to the case where you use 
psql, and try to delete the DB you are connected to;  you have to change DB 
("\c template1" will do it) otherwise you are trying to pull the rug from under 
your own feet.

I haven't found a work-around yet, but then I haven't really tried;  I use psql 
from the command line to do it anyway.  You may want to check whether there is 
a bug filed in pgadmin.postgresql.org on the matter (they may be about to fix 
it)

	Andrew


3/30/03 3:21:43 PM, Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:

>
>I don't know much about pgAdmin itself, but...
>
>On Sun, 30 Mar 2003, Tamir Halperin wrote:
>
>> I remember creating a db called taxcal and it's listed there. However,
>> I don't remember creating a db called pgsql.
>
>It's possible it got created as a side effect of the system upgrade.
>
>> Also, I can't drop it (by right clicking on it and selecting drop
>> object from the shortcut menu. After being warned that the action
>> cannot be undone I agree and an error comes up:
>>
>> "An error as occured in pgAdmin II:basActions.drop:
>>
>> Number: -2147467259
>
>> Description: ERROR: DROP DATABASE: database "pgsql" is being accessed
>> by other users
>
>Are there any connections to it on the server?  You can check with ps.
>
>> Another thing I need help with is the appearance of both "template0"
>> as well as "template1". I can't seem to delete template0 because the
>> error from the drop action informs me that it is marked as a template.
>
>Deleting template0 or template1 (unless you're just going to recreate it
>from template0) is a bad idea.  They're the template databases from which
>new databases are created (IIRC, template0 is just system things and
>template1 can include anything you want to be clone in newly created
>databases - such as language handlers, or wahtever).
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html
>
>




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: pgAdmin II questions
@ 2003-03-31 21:11  Dmitry Morozovsky <marck@rinet.ru>
  parent: Tamir Halperin <tamir@brobus.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Dmitry Morozovsky @ 2003-03-31 21:11 UTC (permalink / raw)
  To: Tamir Halperin <tamir@brobus.net>; +Cc: pgsql-admin

On Sun, 30 Mar 2003, Tamir Halperin wrote:

[please wrap your long lines]

TH> Another thing I need help with is the appearance of both "template0" as
TH> well as "template1". I can't seem to delete template0 because the error
TH> from the drop action informs me that it is marked as a template.

template1 is the database which is used when you do 'create database'; all
custom modifications, such as new data types, languages, etc, are copied to the
database you create

template0 is just copy of the _default_ template1 and is created by initdb, and
then marked 'no connects to me please'. Its existense is mainly for emergency
purposes.


Sincerely,
D.Marck                                   [DM5020, DM268-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-03-31 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-30 18:33 pgAdmin II questions Tamir Halperin <tamir@brobus.net>
2003-03-30 20:21 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2003-03-31 14:56   ` Andrew Biagioni <andrew.biagioni@e-greek.net>
2003-03-31 21:11 ` Dmitry Morozovsky <marck@rinet.ru>

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