Re: DROP TABLESPACE needs crash-resistance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DROP TABLESPACE needs crash-resistance
Date
Msg-id 23796.1289323484@sss.pgh.pa.us
Whole thread Raw
In response to DROP TABLESPACE needs crash-resistance  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Responses Re: DROP TABLESPACE needs crash-resistance
List pgsql-hackers
Gurjeet Singh <singh.gurjeet@gmail.com> writes:
> We are facing a problem in dropping a tablespace after crash recovery. The
> recovery starts from the last checkpoint, but the tables that were created
> by
> a transaction in a tablespace before the checkpoint are still lying around;
> the
> transaction had not finished by the time of crash.

> After recovery, when the app tries to drop the tablespace, the command fails
> because the tablespace directory is not empty.

Hmm.  The reason DROP TABLESPACE fails in that case, rather than just
arbitrarily rm -rf'ing the files, is fear of deleting valuable data by
accident.  I suppose we could have a mode that deletes the files without
any manual intervention, but personally I'd regard that as a foot-gun.

> Solving this problem has become quite critical since the the platform where
> Postgres is being used is supposed to run unattended.

I'm not entirely clear as to the use-case for unattended DROP TABLESPACE?
That doesn't really seem like an operation you should need on a routine
basis.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: proposal: plpgsql - iteration over fields of rec or row variable
Next
From: Greg Stark
Date:
Subject: Re: Protecting against unexpected zero-pages: proposal