0

I have tables which are already in Postgres and partitioned. How can I write a query with partioned birth_year

stmt = select(UserOrm)
session.execute(stmt)`
1

1 Answer 1

0

When using partitioned tables in PostgreSQL, SQLAlchemy does not require any special syntax. You query them the same way you would query a regular table. PostgreSQL handles the partition pruning automatically.

stmt = select(UserOrm).where(UserOrm.birth_year == 1990)
result = session.execute(stmt).scalars().all()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.