Skip to content

[Feature]: Declarative support for foreign servers #8063

@gbartolini

Description

@gbartolini

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

Following #4683, which adds support for declarative foreign data wrappers, we are missing a declarative way to define a foreign server.

Describe the solution you'd like

INCOMPLETE DRAFT of proposal:

apiVersion: postgresql.cnpg.io/v1
kind: Database
metadata:
  name: app
spec:
  name: app
  owner: app
  cluster:
    name: pg-b
  extensions:
  - name: postgres_fdw
    ensure: present
  fdws:
  - name: postgres_fdw
     usage:
     - app
  servers:
  - name: pg-a
    fdw: postgres_fdw
    ensure: present
#    options:
#    - name: host
#      value: foo
#    -name: dbname
#      value: app
    optionsRef:
    - name: pg-a-app
          key: host

Describe alternatives you've considered

Have if under the FDW stanza.

Additional context

No response

Backport?

No

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions