pg_createcluster on an existing data directory: symlink config files instead of moving them
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
postgresql-common (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
My release is 14.04. postgresql-common is 154.
When running pg_createcluster to create a cluster for which the data directory already exists, pg_createcluster copies, and then deletes the configuration files from the data directory. The deleting seems unnecessary, and it seems like a symlink would be better suited here. At the very least, I see no reason to delete the originals.
Specifically, this is a glaring flaw if I have established a database on a different partition from my Ubuntu installation and I want to wipe and reinstall Ubuntu while migrating this data. This is simple in theory, but deleting the config files from the data directory creates a frustrating barrier if I want to do this more than once.
That's the documented behaviour of pg_createcluster, and it tells you what happens too. I'll definitively not just copy the file and leave the original, that would be utterly confusing and prone to getting out of sync. A symlink could work though.