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 data directory πŸ—‚οΈ
  • the wal directory πŸ“
  • the tablespace directories 🧚
  • 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 πŸ¦‹

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