It’s good for quality of service, but means database administrators must create custom views and stored procedures to provide richer endpoints.
The most common causes for custom endpoints are volatility can only read, not modify, the database and Postg REST executes them in a read-only transaction compatible for read-replicas. To supply arguments in an API call, include a JSON object in the request payload and each key/value of the object will become an argument.
This is an RFC7233-compliant solution that keeps the response JSON cleaner.
Then only one permission check will take place, the permission to call the function, and the operations in the function will have the authority of the user who owns the function itself. It also helps emphasize to API consumers that these functions are not normal restful things.For instance, to order the actors in each film: Once again, this restricts the roles included to certain characters but does not filter the films in any way.Films without any of those characters would be included along with empty character lists.When using headers you specify the range of rows desired. This method is also useful for embedded resources, which we will cover in another section.The server always responds with range headers even if you use query parameters to limit the query.There are many other procedural languages distributed as additional extensions.Also, plain SQL can be used to write functions (as shown in the example above).The more familiar nested urls consider only a degenerate case of simple and overwhelmingly numeric primary keys.These so-called artificial keys are often introduced automatically by Object Relational Mapping libraries.For instance, assume we have created this function in the database.Postgre SQL has four procedural languages that are part of the core distribution: PL/pg SQL, PL/Tcl, PL/Perl, and PL/Python.