You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] introspect_postgres() mangles virtual URI path with backslashes on Windows #1672
In graphify/pg_introspect.py, the introspect_postgres() function connects to a PostgreSQL database, retrieves the schema metadata, and formats it as in-memory SQL DDL, which is then parsed by extract_sql().
To serve as a source_file identifier, introspect_postgres() instantiates a virtual URI path using Path:
On Windows, Path parses URI strings as filesystem paths and normalizes them using backslashes (postgresql:\myhost\mydb).
In graphify/extract.py, extract_sql(path: Path) converts this to a string using str(path) (retaining backslashes) and populates the source_file attribute on nodes and edges with this mangled string.
This causes:
Inconsistent and invalid source_file values (e.g., postgresql:\myhost\mydb instead of postgresql:/myhost/mydb).
Test failures in tests/test_pg_introspect.py::test_pg_introspect_success on Windows due to the backslashes.
Reproduction
On Windows, run the test suite for pg_introspect:
python -m pytest tests/test_pg_introspect.py
This fails with:
E AssertionError: assert 'postgresql:\\myhost\\mydb' == 'postgresql:/myhost/mydb'
E
E - postgresql:/myhost/mydb
E ? ^ ^
E + postgresql:\myhost\mydb
E ? ^ ^
Expected Behavior
The URI path postgresql://host/dbname should always use forward slashes (/), even on Windows.
Activity
Fix invalid virtual postgres source_file URI backslashes on Windows (#…
docs: changelog credit for #1671, #1672, #1241
safishamsi commentedon Jul 5, 2026
Fixed in
5ffa921(v8, ships in 0.9.7) via #1675. Thanks for the report.release: 0.9.7
Fix invalid virtual postgres source_file URI backslashes on Windows (G…
docs: changelog credit for Graphify-Labs#1671, Graphify-Labs#1672, Gr…
release: 0.9.7