-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
107682: plpgsql: add support for CONSTANT variable declarations r=DrewKimball a=DrewKimball #### plpgsql: validate PLpgSQL functions during creation This patch ensures that PLpgSQL functions are built during function creation, not just during invocation. This ensures that compile-time errors are thrown when the function is created. This commit also tests and corrects the codes for some of the errors that can be thrown while building a PLpgSQL function. Note that some of the existing tests had to be removed since they called UDFs within other UDFs. We didn't catch this before because the restriction is only checked during function creation when the body statements are first built. Fixes #107681 Release note: None #### plpgsql: add support for CONSTANT variable declarations It is possible to declare variables as CONSTANT in PLpgSQL. This will cause any attempt to assign to the variable to result in a compile-time error. This patch implements CONSTANT variables by adding a check whenever an assignment is built that the assigned variable is non-constant. Fixes #105241 Release note (sql change): Added support for CONSTANT variable declarations in PLpgSQL routines. Any assignment to a variable declared with the CONSTANT keyword will raise a compile-time error. Co-authored-by: Drew Kimball <[email protected]>
- Loading branch information
Showing
6 changed files
with
224 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.