feat(database): add declarative management of foreign servers by EdwinaZhu · Pull Request #8401 · cloudnative-pg/cloudnative-pg

@dosubot dosubot bot added the size:XXL

This PR changes 1000+ lines, ignoring generated files.

label

Sep 8, 2025

@EdwinaZhu EdwinaZhu changed the title Draft: declarative management for Foreign Server Feat: Declarative management for Foreign Server

Sep 8, 2025
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
… of foreign servers

Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
…WIP)

Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>

mnencia

rossigee pushed a commit to rossigee/cloudnative-pg that referenced this pull request

Oct 2, 2025
…ative-pg#8401)

Add support for managing PostgreSQL Foreign Data Wrappers (FDWs) with
foreign servers declaratively via the `spec.servers` field in the
`Database` custom resource.

This enables Kubernetes-native, privilege-aware lifecycle management of
foreign servers without requiring direct SQL execution or superuser
privileges.

Supported configuration includes `name`, `ensure`, `usage`
grants/revokes, and `options`. A foreign data wrapper must already
exist.

Only foreign servers explicitly listed in `spec.servers` are reconciled;
others remain untouched. Reconciliation uses PostgreSQL’s native `CREATE
SERVER`, `ALTER SERVER`, and `DROP SERVER` commands.

Closes cloudnative-pg#8063

Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>

THE-BRAHMA pushed a commit to THE-BRAHMA/cloudnative-pg that referenced this pull request

Oct 30, 2025
…ative-pg#8401)

Add support for managing PostgreSQL Foreign Data Wrappers (FDWs) with
foreign servers declaratively via the `spec.servers` field in the
`Database` custom resource.

This enables Kubernetes-native, privilege-aware lifecycle management of
foreign servers without requiring direct SQL execution or superuser
privileges.

Supported configuration includes `name`, `ensure`, `usage`
grants/revokes, and `options`. A foreign data wrapper must already
exist.

Only foreign servers explicitly listed in `spec.servers` are reconciled;
others remain untouched. Reconciliation uses PostgreSQL’s native `CREATE
SERVER`, `ALTER SERVER`, and `DROP SERVER` commands.

Closes cloudnative-pg#8063

Signed-off-by: YingZhu <yingzhu3@andrew.cmu.edu>
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: theBrahma <office.utpal.brahma@gmail.com>