Inconsistent output for a function call from postgrest API url #1835
-
Hi URL : http://localhost:16000/rpc/fn_name?terms=patents Result:
But after I restart my postgrest docker my result changes to the one below without the function name.
My desired out put is the one without the function name. But I don't know why this inconsistency in the output from postgrest. I tried sending the server a SIGUSR1 signal and also schema reloading. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
If restarting the server helps, but sending a signal or "reload the schema" does not - then you're doing something wrong on the latter. Restarting the server reloads the schema, too. Which version of PostgREST are you using? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. The postgREST version we are using is v7.0.1. First of all, I am not sure which one is the correct output. Once the postgrest is up and running, and I create a function and call it from the API, I am getting the result as an array of object with the function name as the object key. If I restart the postgrest docker, which should reload the schema as well, I am getting the result without the function name (which means the value of the previous results' object key). As i would be doing my db schema, view, function creation dynamically, the results are not consistent as it depends on whether my docker is restarted before the schema/view/function generation. I hope my issue is more clear now. |
Beta Was this translation helpful? Give feedback.
-
The output without the function name is correct. In v7.0.1 this didn't work for all functions, depending on the returned type. We have since cleaned this up a bit and the output should be more consistent in the latest nightly. However, I don't think this is something you are experiencing, because your output is correct once the schema cache is reloaded. We need an uptodate schema cache to be able to tell which return type a function has and then properly format it. There is no way around that.
That's all expected.
In our latest nightly we have added the ability to reload the schema cache via postgres' |
Beta Was this translation helpful? Give feedback.
The output without the function name is correct. In v7.0.1 this didn't work for all functions, depending on the returned type. We have since cleaned this up a bit and the output should be more consistent in the latest nightly. However, I don't think this is something you are experiencing, because your output is correct once the schema cache is reloaded.
We need an uptodate schema cache to be able to tell which return type a function has and then properly format it. There is no way around that.