Skip to content

computed relations from view to view foreign key error #3241

Closed Answered by laurenceisla
MHC2000 asked this question in Q&A
Discussion options

You must be logged in to vote

f I query dt_72?select=,dt_72_test_computed_data() I get the PGRST200 error. Schema cache was reloaded. What am I doing wrong?

I think it's because the function is returning a view that is not present in the exposed schema.

    RETURNS SETOF software.infoapd_smv2v_def 

If it were returning a table or view in the api schema then it would work. You may need to create a similar view on that schema, taking care of not exposing secure data, of course.

Weirdly dt_72?select=*,dt_72_test_computed_data works, but only delivers an object and not an array for dt_72_test_computed_data

Yes, that's because it's treating it as a computed column (not relationship) when no () is specified.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MHC2000
Comment options

@laurenceisla
Comment options

@MHC2000
Comment options

Answer selected by MHC2000
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