Simon Schmitke
01/24/2024, 8:45 PMMELTANO_STATE_BACKEND_URI='file:///Users/myname/Code/meltano-poc/myporject/state/'
and that works ✅
But now I want to save the state in a postgres db (the same one I'm extracting from) in a table called state
. I changed my variable to:
MELTANO_STATE_BACKEND_URI='postgresql://<user>:<password?@localhost:5432/meltano_states'
When I run
meltano run tap-postgres target-snowflake --state-id=staging-sync --full-refresh
, it does not save the state ❌
When I run
meltano run tap-postgres target-snowflake
, I get the error:
Run invocation could not be completed as block failed: Cannot start plugin tap-postgres: 'postgresql' is not a valid StateBackend
Not sure where to go from here. 2 questions:
1. Is it possible to save state in a postgres database?
2. If so, how do I configure my table in postgres to save the state?
Any help would be greatly appreciated!Denis I.
01/24/2024, 9:04 PMpostgresql+psycopg://
postgresql+psycopg2://
Simon Schmitke
01/24/2024, 9:06 PMEdgar Ramírez (Arch.dev)
01/25/2024, 2:51 PMMELTANO_STATE_BACKEND_URI=systemdb
to use one of the supported system dbs as a state backend
• set MELTANO_DATABASE_URI=postgresql://<user>:<password?@localhost:5432/meltano_states
to use your postgres instance as the system databaseDenis I.
01/25/2024, 2:54 PMMELTANO_DATABASE_URI=postgresql+psycopg://
without MELTANO_STATE_BACKEND_URI
? (it works fine)Edgar Ramírez (Arch.dev)
01/25/2024, 2:55 PMsystemdb
is the default value actually. So, if MELTANO_STATE_BACKEND_URI
is not set, Meltano will use the system database.