Description:
After deploying Percona Operator for PostgreSQL I deployed a cluster via cr.yaml and added users and databases that I wanted to host.
Another application, Gitea is also being deployed via helm charts, and it needs to use one of the databases but it tries to alter public schema, which is denied:
2024/09/03 16:35:38 cmd/migrate.go:40:runMigrate() [F] Failed to initialize ORM engine: migrate: sync: pq: permission denied for schema public
Gitea migrate might fail due to database connection...This init-container will try again in a few seconds
I read most of the docs and searched online for answers. I tried different things for users.options
but could not figure out how to make this work.
I don’t want the user to become a superuser, I don’t want that unless there is no other way. Perhaps after doing that once, I can revert to a regular user?
I am not sure what the implications are though. What happens if the next application wants to alter public schema as well?
Any help is appreciated. Thanks in advance.
Steps to Reproduce:
users:
- name: gitea
databases:
- gitea
# options:
Gitea Helm values:
database:
DB_TYPE: postgres
HOST: cluster1-pgbouncer.postgres-operator.svc:5432
SSL_MODE: require
NAME: gitea
USER: gitea
PASSWD: blablabla
Version:
2.4.1
Logs:
I listed part of the log in the description.
Expected Result:
I expected this to happen
Actual Result:
What I would like to accomplish is that one way or another, Gitea can use the database I provisioned. I don’t know if its possible to provide users.options
to allow the public schema to be altered, or if there is any other way to work around this issue?
Additional Information:
I am by no means a database or postgres adept. My expertise is in Linux and Kubernetes. Please go easy on me .