Re: Big 7.1 open items

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Big 7.1 open items
Дата
Msg-id 15787.962208700@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Big 7.1 open items  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Big 7.1 open items  (Bruce Momjian <pgman@candle.pha.pa.us>)
RE: Big 7.1 open items  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> If we put multiple database tables in the same directory, have we
> considered how to drop databases?  Right now we do rm -rf:

rm -rf will no longer work in a tablespaces environment anyway.
(Even if you kept symlinks underneath the DB directory, rm -rf
wouldn't follow them.)

DROP DATABASE will have to be implemented honestly: run through
pg_class and do a regular DROP on each user table.

Once you've got rid of the user tables, rm -rf should suffice to
get rid of the "home tablespace" as I've been calling it, with
all the system tables therein.

Now that you mention it, this is another reason why system tables for
each database have to live in a separate tablespace directory: there's
no other good way to do that final stage of DROP DATABASE.  The
DROP-each-table approach doesn't work for system tables (somewhere along
about the point where you drop pg_attribute, DROP TABLE itself would
stop working ;-)).

However I do see a bit of a problem here: since DROP DATABASE is
ordinarily executed by a backend that's running in a different database,
how's it going to read pg_class of the target database?  Perhaps it will
be necessary to fire up a sub-backend that runs in the target DB for
long enough to kill all the user tables.  Looking messy...
        regards, tom lane


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

Предыдущее
От: "Oliver Elphick"
Дата:
Сообщение: Problem creating UNIQUE constraint
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ./configure bug in CVS