PG_DROPCLUSTER(1)
β¨ NAME β¨
pg_dropcluster β completely delete a PostgreSQL cluster ππ«Ά
so like. the whole thing. gone. every last crumb. this is from the Debian PostgreSQL infrastructure besties, and she does NOT do partial.
π SYNOPSIS π
pg_dropcluster [--stop] cluster-version cluster-name
that's it. that's the whole ritual. give her a cluster-version and a cluster-name and she'll handle the rest πΈ
π DESCRIPTION π
okay so listen. this program removes all files that belong to a given PostgreSQL cluster. all of them. every single one. and bestie that includes:
- the
datadirectory ποΈ - the
waldirectory π - the
tablespacedirectories π§ - the log file π
- all configuration files that were created by
pg_createcluster(1)βοΈ
no leftovers, no crumbs, no "oh I'll clean that up later". she's thorough.
and THEN β plot twist β if the configuration directory (/etc/postgresql/version/cluster) is empty after all that, it gets removed too. goodbye. and an empty socket directory that isn't /var/run/postgresql or /tmp? also removed. she's not leaving random empty rooms in the house, that's giving haunted mansion energy π»
π¨ ok important part bestie: usually a cluster that still has a running server attached will not be deleted. like, if the server is up, she just... won't. protection mode. to override that, the --stop option forces a server shutdown before the files are removed. so it kills the server first and then does the deleting. use that one on purpose, not by accident, ok? π
π¦ SEE ALSO π¦
pg_createcluster(1)β the one who built her in the first place ποΈpg_ctlcluster(1)β the one who controls her π
iykyk π
π AUTHOR π
Martin Pitt <mpitt@debian.org> β icon, legend, the moment, fr fr π«Ά
and that's the page bestie!! this one shipped from Debian, dated 2026-07-28, and if you ever wondered what that PG_DROPCLUSTER(1) at the bottom of the screen means β now you know π stay hydrated, back up your data, and please don't --stop anything you aren't ready to say goodbye to. mwah πβ¨
π¦ where this page comes from
- ubuntu stonking: postgresql-common 293ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms