Skip to content

Document that cloud postgres delete needs no stop first - #625

Merged
sdairs merged 1 commit into
fix/614-postgres-delete-jsonfrom
feat/615-postgres-delete-force
Sep 3, 2026
Merged

Document that cloud postgres delete needs no stop first#625
sdairs merged 1 commit into
fix/614-postgres-delete-jsonfrom
feat/615-postgres-delete-force

Conversation

@sdairs

@sdairs sdairs commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #615

Stacked PR — based on fix/614-postgres-delete-json (#624), not main. Review/merge that one first; this diff is docs-only.

What

Issue #615 asked for --force on cloud postgres delete so a running Postgres service can be deleted in one step, mirroring cloud service delete --force. Investigating it showed the premise does not hold for Postgres, so this PR documents the actual behaviour instead of adding a flag.

Why there is no flag

cloud service delete --force exists because that API refuses to delete a running ClickHouse service and there is a stop command to issue first. The Postgres API has neither half:

  • DELETE /v1/organizations/{organizationId}/postgres/{postgresId} declares no state precondition (checked against the live spec; the library's own integration cleanup, tests/common/support.rs::ensure_postgres_gone, deletes running services directly).
  • PATCH /v1/organizations/{organizationId}/postgres/{postgresId}/state accepts only restart, promote and switchover — there is no Postgres stop command. PostgresServiceSetStateCommand has no Stop variant because the spec has no such value.

A running Postgres service is therefore already deleted in one step, with no flag. An earlier revision of this PR added --force as an accepted no-op for surface parity; that was dropped in review — a flag that performs nothing teaches the wrong thing about the one on service delete, which really does stop the service.

Change

  • postgres delete gains a CONTEXT FOR AGENTS help block stating that no stop is needed first because the Cloud API deletes a Postgres service from any state, including running.
  • The README postgres delete example says the same in one line.

No code paths, request shapes, exit codes or --json output change. Passing --force remains a clap usage error (exit 2), as before.

🤖 Generated with Claude Code

@sdairs
sdairs force-pushed the feat/615-postgres-delete-force branch from 79f6415 to 5de6846 Compare August 28, 2026 14:46
@sdairs sdairs linked an issue Aug 28, 2026 that may be closed by this pull request
@sdairs
sdairs force-pushed the feat/615-postgres-delete-force branch from 5de6846 to a5b1ee8 Compare August 28, 2026 19:41
@sdairs
sdairs force-pushed the feat/615-postgres-delete-force branch from a5b1ee8 to c1399c7 Compare September 1, 2026 15:05
`cloud service delete --force` exists because that API refuses to delete a
running service and there is a stop command to issue first. The Postgres API
has neither half: `DELETE .../postgres/{id}` declares no state precondition
and the state endpoint accepts only restart, promote and switchover. So a
`--force` flag here could only ever be a no-op, and a flag that does nothing
teaches the wrong thing about the one on `service delete`.

Instead, the command's CONTEXT FOR AGENTS block and the README example say
what is actually true: a Postgres service deletes from any state, including
'running', with no stop needed first.

Closes #615

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sdairs sdairs changed the title Accept --force on cloud postgres delete for surface parity with service delete Document that cloud postgres delete needs no stop first Sep 1, 2026
@sdairs
sdairs force-pushed the feat/615-postgres-delete-force branch from c1399c7 to e6c9022 Compare September 1, 2026 20:36

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sdairs
sdairs merged commit 0e5a434 into main Sep 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud postgres delete lacks --force (inconsistent with service delete)

2 participants