Skip to content

PostgreSQL Loader: Single-Schema Limitation & Missing Multi-Schema / Multi-DB Support #496

@zthafir

Description

@zthafir

Summary

The current PostgreSQL loader in QueryWeaver only supports a single schema when building the database graph. This leads to incomplete or incorrect graph representations for databases that rely on multiple schemas.

Additionally, there is no support for building graphs from multiple databases simultaneously, which limits usability in real-world environments.


Problem Description

1. Single Schema Limitation

The loader extracts the schema using:

schema = PostgresLoader.parse_schema_from_url(connection_url)

However:

  • parse_schema_from_url only returns the first schema from search_path
  • The session is then forced to use only that schema:
SET search_path TO {schema}

Resulting Behavior

  • Only one schema is loaded into the graph
  • Additional schemas in search_path are ignored
  • Cross-schema relationships are not captured

Impact

This affects many real-world PostgreSQL setups, including:

  • Multi-schema architectures (e.g. auth, billing, analytics)
  • Multi-tenant systems
  • Modular database designs
  • Systems relying on cross-schema foreign keys

The resulting graph is incomplete and potentially misleading.


2. Missing Multi-Database Support

Currently, the loader builds a graph from a single database connection URL.

There is no support for:

  • Loading multiple databases into one graph
  • Merging schemas across databases
  • Representing cross-database relationships (logical or external)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions