Closed bkcsfi closed 8 months ago
I found a workaround.
I reviewed the source for the temporal-sql-tool to see how it handles the create process. That code is supposed to recognize that the database already exists. However the create step fails because the db user is not authorized to create a database.
My workaround was to change the cloudnative-pg configuration so that the default database user is also a superuser. This is not a great solution, but moves things forward.
I think I will open a case with temporal to see if the temporal-sql-tool can handle this situation better.
thanks
Hi @bkcsfi !
The operator already provides a feature to support your use case.
On the datastore spec you can use the skipCreate
field, see:
https://temporal-operator.pages.dev/api/v1beta1/#temporal.io/v1beta1.DatastoreSpec
great, thank you for pointing that out. I will give that a try in the production deployment.
Hi,
I am trying to setup a temporal cluster with postgres based on cloudnative-pg
The database and user already exists when the temporal operator starts.
However the schema setup process fails with this error:
I believe its failing because the create-default-database.sh script always attempts to create the database.
I've tried editing the configmap in argocd and k9s to comment out this script, but I can't seem to change it.
Unfortunately the temporal-sql-tool doesn't appear to support a 'create if not exists' option.
Any suggestions on how to get temporal-operator to bypass this step since the databases already exist?