Skip to content

SQLAlchemy not finding tables in two postgres separate schemas at same time #3716

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Alex Petralia (@alexpetralia)

SQLAlchemy version: 1.0.12

I originally raised this issue as a bug with pandas but I believe it is actually an issue with SQLAlchemy: pandas-dev/pandas#13210 (comment)

I have a SQLAlchemy Engine object:

In[11]: SQLALCHEMY_CONN
Out[11]: Engine(postgresql://***:***@***:***/***)

In the schema a, I have a table named ads_skus which has a foreign key reference to a table sku in the public schema.

In[12]: SQLALCHEMY_CONN.has_table('ads_skus', schema='a')
Out[12]: True

SQLAlchemy can find the table in the same schema, but not the foreign table in the public schema:

In[13]: 
from sqlalchemy.schema import MetaData
meta = MetaData(SQLALCHEMY_CONN, schema='a')
meta.reflect(only=['ads_skus'], views=True)
Out[13]: NoSuchTableError: sku

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingschemathings related to the DDL related objects like Table, Column, CreateIndex, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions