postgrest-docs icon indicating copy to clipboard operation
postgrest-docs copied to clipboard

Resource Embedding with Foreign Table Wrapper

Open aramean opened this issue 4 years ago • 1 comments

PostgREST needs FOREIGN KEY constraints to be able to do Resource Embedding. What about foreign tables? Is it necessary to create a view in order to solve this issue?

aramean avatar Aug 19 '21 17:08 aramean

I think you might be interested in reading:

  • https://github.com/PostgREST/postgrest/issues/915#issuecomment-780035727
  • https://github.com/PostgREST/postgrest/issues/1179

TLDR: Your best bet is to create a virtual column via function, that contains the embedding of the foreign table.

wolfgangwalther avatar Aug 22 '21 08:08 wolfgangwalther

This is now documented on https://postgrest.org/en/stable/api.html#computed-relationships

steve-chavez avatar Sep 01 '22 17:09 steve-chavez