Skip to content

DROP DATABASE needs a WITH (FORCE) option #397

Description

@nicolasburtey

The Database reconciler's delete issues a bare DROP DATABASE IF EXISTS <name> (pkg/controller/cluster/postgresql/database/reconciler.go), which fails with 55006 object_in_use whenever any backend holds a connection to the target DB — routine for any app with a connection pool — leaving the managed resource stuck Terminating forever.

Since Postgres 13+ supports DROP DATABASE … WITH (FORCE) (which terminates other backends before dropping)

exposing a forProvider.force / deletionPolicy-style flag that emits the WITH (FORCE) form — or a pre-terminate step — would let providers reconcile deletion reliably against pooled apps without requiring an out-of-band pg_terminate_backend script.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions