Closed putheng closed 1 year ago
Could you share your postgREST version? It can be done as mentioned here.
Also try doing NOTIFY pgrst, 'reload schema';
.
This is my version "info": { "description": "standard public schema", "title": "PostgREST API", "version": "9.0.1.20220717 (pre-release) (d2df289)" }
Solved by upgrading PostgREST to 10.1.1 (aaa4fbc)
I'm using a self-hosted Supabase and I switched out the postgrest container to postgrest/postgrest:v10.1.1.20221215
, but I'm still seeing an issue with queries using !inner
returning an array of 1 instead of an object. For those that have successfully got this working, any thoughts?
Bug report
Computed relationships: Could not find a relationship
Describe the bug
Try to get computed relationships from
foreigndb_fdw
server by create a local table nameloans
that hasorder_id
and create a function callorders
This is loans table
orders
functionproduct_orders
fromforeigndb_fdw
serverTo Reproduce
Call RESTApi url
/rest/v1/loans?select=*,orders
i got one-to-one relationship https://postgrest.org/en/stable/api.html#computed-colsCall RESTApi with url
/rest/v1/loans?select=*,orders(*)
https://postgrest.org/en/stable/api.html#computed-relationshipsExpected behavior
It should return setof relationship table https://postgrest.org/en/stable/api.html#computed-relationships
Additional context
Any way, I try to define the opposite one-to-many relationship
than return multiple row instead of one-to-many