#34232·dagster

Transient bump to SQLAlchemy >=2.1 creates dependency trap: Missing 'psycopg' vs 'NOTIFY run_events, $1' syntax error

Author: nyc-deCreated Sep 26, 2026Updated Oct 1, 2026
Labelstype: bug

What's the issue?

SQLAlchemy transitive bump breaks PostgreSQL storage (psycopg ModuleNotFoundError / NOTIFY $1 error)

Summary

A transitive dependency bump of sqlalchemy (to 2.1.x / 2.0.x) introduces a catch-22 / "rock and a hard place" state when using dagster-postgres:

  1. psycopg2 failure: SQLAlchemy defaults to using psycopg (v3). If psycopg is missing, Dagster fails on startup with: ModuleNotFoundError: No module named 'psycopg'

  2. psycopg (v3) failure: Installing psycopg causes Dagster's event log storage to fail on run monitoring with: sqlalchemy.exc.ProgrammingError: (psycopg.errors.SyntaxError) syntax error at or near "$1" [SQL: NOTIFY run_events, %(notify_id)s;]

Expected Behavior

Dagster should gracefully handle PostgreSQL storage without requiring manual driver overrides or breaking when transitive dependencies update SQLAlchemy.

Workaround

Pin sqlalchemy==2.0.54

What did you expect to happen?

No response

How to reproduce?

No response

Dagster version

1.13.0

Deployment type

Docker Compose

Deployment details

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a ! We factor engagement into prioritization.