Basically you have to return a table and can't use setof if you add any column to an existing table records (for example from a join).
u
6ary
01/31/2022, 2:20 AM
so I'd have to remove setof?
g
garyaustin
01/31/2022, 2:29 AM
You have to create a return table description and specify all the columns from main table and join tables you want returned. But I'm not much help as clear in that thread it was a learning experience. You would have to use the sql editor though not the function ui.
j
jaf
01/31/2022, 12:02 PM
Yep, the supabase UI for creating functions is very limited. You can look at my post directly above yours for an example of how to return a table from a function. Basically you need to know the EXACT return type of every column. Also don't expect to be able to edit your custom functions through the UI