I have following Chart.yaml
dependencies:
- name: postgresql
version: 11.6.7
repository: "@bitnami"
condition: postgresql.enabled
values.yaml:
postgresql:
auth:
database: ...
password: ...
postgresPassword: ...
metrics:
...
enabled: true
serviceMonitor:
enabled: true
...
primary:
initdb:
scriptsConfigMap: "postgres-init-scripts-config"
And inside the config I have following:
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
I start my appplication and then I try to run following query:
I hasn't found answer here also: https://github.com/bitnami/charts/issues/2067
select * from pg_stat_statements;
and restart is:
ERROR: pg_stat_statements must be loaded via shared_preload_libraries
SQL state: 55000
I have read this topic: pghero on PostgresApp pg_stat_statements must be loaded via shared_preload_libraries
And based on other topics from SO looks ike I need to restart postgres. But I don't know how can I acheve it.
Also this topic hasn't given me the answer how to enable extension properly in helm chart.
P.S. In my case I create database inside postgres-init-scripts-config and I need to have extension pg_stat_statements enabled for that database
I was able to fix after I've added:
postgresql
metrics
primary:
extendedConfiguration: |
shared_preload_libraries = 'pg_stat_statements' # (change requires restart)
pg_stat_statements.max = 10000
pg_stat_statements.track = all