Skip to content

Join tables across different schemas #2769

Answered by steve-chavez
sindreolsenhk asked this question in Q&A
Discussion options

You must be logged in to vote

It's not possible to do it directly right now, see #2346

From the documentation it seems you have to switch schemas per request, but maybe there is a workaround.

If you have a schema1.table1 related(with foreign key) to schema2.table2, then you could create a view of schema1.table1 into schema2. PostgREST will discover the tables' relationship and you'll be able to do resource embedding on them.

See https://postgrest.org/en/v8.0/how-tos/embedding-table-from-another-schema.html

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindreolsenhk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants