-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Version: 2.0.1
Database: Postgres 12.6
Version: Self-hosted
We are using a docker-image and we regularly change databases, and we regularly copy databases between postgres instances (pg_dump and pg_restore). With v1 we were using an env vars to change between databases.
However since v2, hasura will now use the environment variable to connect to a database, then read the metadata stored in hdb_metadata and proceed to update the database connection to what is stored in the meta data.
This causes hasura to be looking at the incorrect database. Worse for us, is because these databases are identical there is no way for us to know without manually checking the connection string.
We've had to write a script that will drop hdb_catalog after each pg_dump.
I am not sure of the best solution to this. But it seems very strange behaviour to use the connection string, connect to the database, read the metadata, and instantly connect to entirely different database (the logs also do not show this reconnection. It just shows the initial database connection)