-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgrest composite type casting error #475
Comments
I found out that creating an explicit cast between my type and JSON solves the problem, but I'm wondering if there's any other less complicated workaround with the same effect create cast (tp_company as json) with function to_json as implicit; |
@Torres1080 Hm, this should work normally, could you try the example on: https://postgrest.org/en/stable/references/api/tables_views.html#composite-array-columns |
@steve-chavez I did some debugging with my two projects, and the queries I found that are being made under the hood are the following As you can appreciate on the left picture (the new project with the bug), there's no such |
@Torres1080 Can you compare both projects PostgREST versions? You can get it from the |
@steve-chavez 11.2 (not working) vs 11.1 (working) |
@Torres1080 Thanks for the report. We're going to fix this on PostgREST/postgrest#2929. |
@steve-chavez You're welcome 👍 |
Closing this as it's already fixed in the latest PostgREST release. |
Bug report
Describe the bug
After creating a clone of my own project I found a problem after executing some functions which relies on a postgrest rpc call. The function itself returns a composite type with the following parameters
where tp_company has the following implementation
The function barely makes a simple select * from a table application and returns a set of tp_minified_application.I've tested it and it works fine.
The problem I'm facing is that when I make the call within my code
I get this error
operator does not exist: tp_company->> unknown
This could be it but on the other project I have with the exact same code It's working perfectly as it is on the example.
To Reproduce
Just creating the types and a simple function should work
Expected behavior
Whenever I make this query it should work and give correct results filtered by the company I'm asking.
System information
Additional context
Thanks in advance
The text was updated successfully, but these errors were encountered: