Skip to content

Allow db extensions to be configured declaratively #490

@redbaron

Description

@redbaron

Extensions are to be enabled per database and application normally cannot do it as it doesn't use superuser. What do you think about changing pg.spec.databases to following (can be done in a backward compatible way were old shape of this key is transformed into new one with empty extensions key):

databases:
  dbname:
     owner: "user"
     extensions: ["pgcrypto"]

then operator checks for enabled extension in a reconciliation loop and enables missing ones.

With this change it would be fairly straightforward to start using new extension without manual intervention.

Alternative approach is to have a dedicated migration step in CI/CD pipeline which uses superuser to make all necessary adjustments, but this might be a bigger change for some setups (like ours) where application is responsible for it's own migrations at start time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions