Parameters to SQL functions are not supported
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
As SQL function contents are always executed with prepared statement parameters in place, without using the plancache/custom plan logic, our current implementation of prepared statements doesn't work for SQL functions.
The current state of prepared statement support is:
| | prepare | pl/pgsql | sql function |
| :-- | :-- | :-- | :-- |
| **Router Executor** | | | |
| Select - Partition Column | Always | Always | Fails (uses real-time) |
| Insert - Partition Column | Always | Always | Fails |
| Update - Partition Column | Always | Always | Fails |
| Delete - Partition Column | Always | Always | Fails |
| Select - Non-Partition Column | Always | Always | Fails (uses real-time) |
| Insert - Non-Partition Column | Always | Always | Always |
| Update - Non-Partition Column | Always | Always | Always |
| Delete - Non-Partition Column | Always | Always | Always |
| **Real-time Executor** | | | |
| Partition Column | Always | Always | Fails |
| Non-Partition Column | Always | Always | Fails |
| **Task-tracker Executor** | | | |
| Partition Column | Always | Always | Fails |
| Non-Partition Column | Always | Always | Fails |
There are no immediate plans to implement parameters to SQL functions. Therefore for now the fix is to use plpgsql (or other languages) instead of sql functions.
Contributor guide
Assessment
This issue has not been assessed yet.