RPC Call
POST/v1/rdb/rest/rpc/:function_name
Call stored procedures or custom functions in PostgreSQL (powered by PostgREST RPC). Supports passing parameters and returns function execution results.
Request
Path Parameters
Stored procedure or function name
Query Parameters
Return fields, supports * or specified field list, used to filter columns returned by the function
Limit return count (effective when function returns a set)
Offset, used for pagination (effective when function returns a set)
Sort field, format is field.asc or field.desc (effective when function returns a set)
Header Parameters
params=single-objectpasses the request body as a single JSON parameter to the functioncount=exactreturns exact count
Preference settings:
- application/json
Body
object
Responses
- 200
- 400
- 401
- 404
Call successful
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
- MOD3
- Array [
- ]
object
object
string
[
null
]
Request error, such as function not found or parameter error
- application/json
- Schema
- Example (from schema)
Schema
Error code
Error details
Error hint
Error message
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}
Authentication failed
- application/json
- Schema
- Example (from schema)
Schema
Error code
Error details
Error hint
Error message
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}
Function does not exist
- application/json
- Schema
- Example (from schema)
Schema
Error code
Error details
Error hint
Error message
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}