-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
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.