zalando / zalando/postgres-operator

[Feature Request] Delete a database and a user in a running cluster

Open
#1,522 0 comments 10 reactions 0 assignees View on GitHub

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 pg command, I would like to get a command like delete-db and delete-user instead of deleting the entire cluster

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.