Re: Big 7.1 open items - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Big 7.1 open items
Date
Msg-id 15787.962208700@sss.pgh.pa.us
Whole thread Raw
In response to Big 7.1 open items  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses 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>)
List 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 by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Problem creating UNIQUE constraint
Next
From: Tom Lane
Date:
Subject: Re: ./configure bug in CVS