diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-01-14 10:46:49 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-01-17 10:38:23 +0100 |
commit | 941460fcf731a32e6a90691508d5cfa3d1f8eeaf (patch) | |
tree | 2de0be4abcf7db131607ce9ba590a8040c16d6e3 /src/backend/commands/functioncmds.c | |
parent | ca86a63d207aca1f52ff13a1ce13854681d1bbf9 (diff) | |
download | postgresql-941460fcf731a32e6a90691508d5cfa3d1f8eeaf.tar.gz postgresql-941460fcf731a32e6a90691508d5cfa3d1f8eeaf.zip |
Add Boolean node
Before, SQL-level boolean constants were represented by a string with
a cast, and internal Boolean values in DDL commands were usually
represented by Integer nodes. This takes the place of both of these
uses, making the intent clearer and having some amount of type safety.
Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/8c1a2e37-c68d-703c-5a83-7a6077f4f997@enterprisedb.com
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r-- | src/backend/commands/functioncmds.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 119b7959827..25b75375a8e 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -813,15 +813,15 @@ compute_function_attributes(ParseState *pstate, if (transform_item) *transform = transform_item->arg; if (windowfunc_item) - *windowfunc_p = intVal(windowfunc_item->arg); + *windowfunc_p = boolVal(windowfunc_item->arg); if (volatility_item) *volatility_p = interpret_func_volatility(volatility_item); if (strict_item) - *strict_p = intVal(strict_item->arg); + *strict_p = boolVal(strict_item->arg); if (security_item) - *security_definer = intVal(security_item->arg); + *security_definer = boolVal(security_item->arg); if (leakproof_item) - *leakproof_p = intVal(leakproof_item->arg); + *leakproof_p = boolVal(leakproof_item->arg); if (set_items) *proconfig = update_proconfig_value(NULL, set_items); if (cost_item) @@ -1417,12 +1417,12 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt) if (volatility_item) procForm->provolatile = interpret_func_volatility(volatility_item); if (strict_item) - procForm->proisstrict = intVal(strict_item->arg); + procForm->proisstrict = boolVal(strict_item->arg); if (security_def_item) - procForm->prosecdef = intVal(security_def_item->arg); + procForm->prosecdef = boolVal(security_def_item->arg); if (leakproof_item) { - procForm->proleakproof = intVal(leakproof_item->arg); + procForm->proleakproof = boolVal(leakproof_item->arg); if (procForm->proleakproof && !superuser()) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), |