I’m Trying to connect Prefect to an existing DB (I already have a db called orion inside it).
And im getting this error while doing so:
sqlalchemy.exc.ProgrammingError: (sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.UndefinedFunctionError'>: functio
n gen_random_uuid() does not exist
atool-application-1 | HINT: No function matches the given name and argument types. You might need to add explicit type casts.
atool-application-1 | [SQL:
atool-application-1 | CREATE TABLE flow (
atool-application-1 | id UUID DEFAULT (GEN_RANDOM_UUID()) NOT NULL,
atool-application-1 | created TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
atool-application-1 | updated TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
atool-application-1 | name VARCHAR NOT NULL,
atool-application-1 | tags JSONB DEFAULT '[]' NOT NULL,
atool-application-1 | CONSTRAINT pk_flow PRIMARY KEY (id),
atool-application-1 | CONSTRAINT uq_flow__name UNIQUE (name)
atool-application-1 | )
atool-application-1 |
atool-application-1 | ]
atool-application-1 | (Background on this error at: https://sqlalche.me/e/14/f405)
atool-application-1 |
atool-application-1 | ERROR: Application startup failed. Exiting.
atool-application-1 | Orion stopped!
I know it does connect to the DB, because when I delete the DB, I’m getting an error that it can’t find it.
Would love to get help.
The PG version appears to be 9.5, If It’s crucial.
atool-application-1 | raise translated_error from error
atool-application-1 | sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.ActiveSQLTransactionError'>: ALTER TYPE ... ADD ca
nnot run inside a transaction block
atool-application-1 | [SQL: ALTER TYPE state_type ADD VALUE IF NOT EXISTS 'CRASHED';]
atool-application-1 | (Background on this error at: https://sqlalche.me/e/14/dbapi)
atool-application-1 |
atool-application-1 | ERROR: Application startup failed. Exiting.
atool-application-1 | Orion stopped!