Re: pgAdmin II questions

Поиск
Список
Период
Сортировка
От Andrew Biagioni
Тема Re: pgAdmin II questions
Дата
Msg-id NLSMZY3WRLMKHFRQSQ31427494QM1W6Z.3e88571f@Laptop
обсуждение исходный текст
Ответ на Re: pgAdmin II questions  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список 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
>
>


В списке pgsql-admin по дате отправления:

Предыдущее
От: Beatrice Yueksel
Дата:
Сообщение: question regarding REFERENCES and INHERITS
Следующее
От: Robert Treat
Дата:
Сообщение: Re: Realistic upper bounds on table size