Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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 by date
|Next:||From: Tom Lane||Date: 2000-06-28 16:22:35|
|Subject: Re: ./configure bug in CVS |
|Previous:||From: Hannu Krosing||Date: 2000-06-28 16:09:05|
|Subject: Re: MySQL has gone GPL|