postgrest-docs
postgrest-docs copied to clipboard
Note about not supporting Stored Procedures
PostgreSQL 11 supports CREATE PROCEDURE
see https://www.postgresql.org/docs/11/static/xproc.html, change the terms to be more precise in the next version.
Actually the proper term for generalizing procedure/function is "routine" I believe. But most people will look for "stored procedures".
Pg 11 stored procedures are not supported since they don't play well with transactions for now, see https://github.com/PostgREST/postgrest/issues/1210.
Perhaps we could add a note about this.
Would you like a PR for this? It was pretty confusing for it to return: To call a procedure, use CALL
The documentation made me think it was supported because there is a part about stored procedures: http://postgrest.org/en/v7.0.0/api.html#stored-procedures
Would this documentation change be good: renaming the section of the link above + adding a warning that procedures are not supported because of details about transactions
Also, I wanted to use procedures because I though procedures were wrapped in a transaction. I read in issue #1210 that there is a transaction through postgrest: would that revert inserts made in the function if the function fails?
@Videl I think a warning about pg 11 stored procedures would be nice. However I'm not sure about renaming the section because many people conflate pg procedures with pg functions.
I read in issue #1210 that there is a transaction through postgrest: would that revert inserts made in the function if the function fails?
Yes, the insertions would be ROLLBACKed.