I'm using postgREST to generate a http accessible api (great stuff). There is a little bug that I'm trying to work around.
For whatever reason, when calling a function, and only in the function parameters, I cannot use the types the api
can normally reference using qualified notation e.g., core.my_type
. It can however access api.my_type
where of course I don't need to qualify the type.
So, to be clear, it all works in postgres. It's just a quirk with the postgREST.
One work-around that is prone to error over time, is to copy/paste the definition of each type in each of the schemas.
The other is the topic of this post: is there a way to automatically create a copy of the type in the core
schema to one in the api
? Or, is there a way to reference the core.my_type
using an alias? (not sure if the latter would solve the problem, but perhaps worth a try).
I realize it would require casting where required. However, it does solve the problem of tracking the entries in each of the enums
(in this case).