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.
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.