zalando / zalando/postgres-operator
[Feature Request] Delete a database and a user in a running cluster
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
I would like to be able to delete a database and a user inside a running cluster from the manifest.
- Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.5.0
- Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s
- Are you running Postgres Operator in production? yes
- Type of issue? feature request
Details
I saw that in database.go there are several constants with the SQL command for each one, it would be interesting to have something like this:
const (
...
deleteDatabaseSQL = `DROP DATABASE "%s"`
deleteUserSQL = `DROP USER "%s"`
...
)
- In the
kubectl pgcommand, I would like to get a command likedelete-dbanddelete-userinstead of deleting the entire cluster
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/cluster/database.go, especially the existing SQL command constants, then trace the kubectl pg command entry points. Determine how manifest-driven database and user deletion should be represented and how delete-db and delete-user would operate on a running cluster. Done means the requested operations are supported without deleting the entire cluster and are covered by appropriate verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- cli, databases, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100