Re: [GENERAL] Restart after power outage: createdb - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Restart after power outage: createdb
Date
Msg-id 6579.1159390371@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Restart after power outage: createdb  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: [GENERAL] Restart after power outage: createdb  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-hackers
"Jim C. Nasby" <jim@nasby.net> writes:
> Then again, if we're doing that, we could probably just nuke 'em...

This has been considered and rejected before, on the grounds that
removing files you don't know the source of is a good way to lose data.

Come to think of it, that argument bears on the immediate problem too.
The way createdb() is coded, if it gets a failure (like "File exists")
trying to create the database's directories, it will attempt to apply
remove_dbtablespaces() to clean up after itself.  This would result in
removing the pre-existing directory, which violates the principle of
not removing unexpected files.  So now I'm starting to think we do need
a check-for-conflicting-files step in createdb.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: [GENERAL] Restart after power outage: createdb
Next
From: Chris Browne
Date:
Subject: Re: PostgreSQL HA questions