Limitation in `pg_lsclusters` and `pg_dropcluster --stop` on Debian-based Systems
Package:`postgresql-common`
Version:17
Severity:Wishlist
Reported by:Akash
Date:18/02/2025
There are a couple of limitations observed with the PostgreSQL management
utilities `pg_lsclusters` and `pg_dropcluster --stop` on Debian-based
systems. These limitations may impact users managing PostgreSQL clusters
manually or with custom configurations. Below are the details:
1. `pg_lsclusters` Does Not List Manually Created Clusters
Limitation:
The `pg_lsclusters` utility currently does not list clusters that are
manually created using `initdb` and `pg_ctl`. These clusters are running
and functional but do not appear in the `pg_lsclusters` output.
Suggested Enhancement:
It would be useful if `pg_lsclusters` could detect and display all running
PostgreSQL clusters, including those created manually, for better
visibility and management.
2. `pg_lsclusters` Does Not Reflect Custom Ports
Limitation:
When a PostgreSQL cluster is started with a custom port using
`pg_ctlcluster` (e.g., `-o "-p <port>"`), `pg_lsclusters` reports the
default port from the `postgresql.conf` file, not the actual port in use by
the running instance.
Suggested Enhancement:
`pg_lsclusters` could be updated to reflect the actual runtime port of the
PostgreSQL process, providing accurate information for users.
3.`pg_dropcluster --stop` Deletes Clusters Without Confirmation
Limitation:
The `pg_dropcluster --stop` command deletes the PostgreSQL cluster
immediately without any confirmation prompt or warning.
Suggested Enhancement:
Adding a confirmation prompt or warning message before proceeding with the
deletion of a PostgreSQL cluster would help prevent accidental data loss.
Expected Behavior:
1. For `pg_lsclusters`:
The utility should list manually created clusters and reflect the actual
runtime port in use.
2. For `pg_dropcluster --stop`:
The command should prompt for confirmation before dropping a cluster to
avoid unintentional data loss.
Suggested Fixes:
1. For `pg_lsclusters`:
Modify the utility to scan for all PostgreSQL clusters, including
manually created ones, and check the actual running PostgreSQL process for
port information.
2. For `pg_dropcluster --stop`:
Introduce a confirmation prompt or warning before dropping a cluster to
protect users from accidental deletion.
Environment:
- **Operating System:** Debian-based system (e.g., Ubuntu 24.04)
- **PostgreSQL Version:** 17
- **Debian Package Version:** `postgresql-common` (version related to
PostgreSQL 17)
Additional Information:
Replication images are included to provide further clarification of the
observed limitations. Please refer to the attached images for more detailed
examples.
pg_dropcluster
sudo pg_dropcluster 17 main
WARNING: You are about to delete the PostgreSQL cluster 17/main.
This action is irreversible and will permanently delete all data.
Are you sure? (yes/no):
Like this I have added the option while dropping the cluster
Thank you for considering this request. Please feel free to contact me if
you need additional information or clarification on the suggestions
described.
Sincerely,
Akash
Attachments:
Screenshot from 2025-02-18 10-32-48.pngimage/png; name="Screenshot from 2025-02-18 10-32-48.png"Download+0-1
On Monday, February 17, 2025, AKASH <akashbhujbal7051@gmail.com> wrote:
Package:`postgresql-common`
Version:17
Severity:Wishlist
Reported by:Akash
Date:18/02/2025
This isn’t a good place to publish such a wishlist since these tools are
not written by the core project developers for whom this list exists.
That said, neither 1 nor 2 seems all that likely to happen - either use the
tooling provided, and its conventions, or don’t.
The confirmation prompt for 3 I could see happening but it really isn’t how
Linux tooling is done generally, so I wouldn’t hold my breath. Especially
if you need someone to write the patch, not just approve it.
David J.
Thankyou for Clarification
On Tue, Feb 18, 2025 at 10:47 AM David G. Johnston <
david.g.johnston@gmail.com> wrote:
Show quoted text
On Monday, February 17, 2025, AKASH <akashbhujbal7051@gmail.com> wrote:
Package:`postgresql-common`
Version:17
Severity:Wishlist
Reported by:Akash
Date:18/02/2025This isn’t a good place to publish such a wishlist since these tools are
not written by the core project developers for whom this list exists.That said, neither 1 nor 2 seems all that likely to happen - either use
the tooling provided, and its conventions, or don’t.The confirmation prompt for 3 I could see happening but it really isn’t
how Linux tooling is done generally, so I wouldn’t hold my breath.
Especially if you need someone to write the patch, not just approve it.David J.