diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/function.c | 32 | ||||
| -rw-r--r-- | src/plproxy.h | 20 |
2 files changed, 43 insertions, 9 deletions
diff --git a/src/function.c b/src/function.c index 6107795..19b77ad 100644 --- a/src/function.c +++ b/src/function.c @@ -356,15 +356,29 @@ fn_get_arguments(ProxyFunction *func, for (i = 0; i < total; i++) { - if (modes && modes[i] == 'o') - continue; - type = plproxy_find_type_info(func, types[i], 1); - pos = func->arg_count++; - func->arg_types[pos] = type; - if (names && names[i]) - func->arg_names[pos] = plproxy_func_strdup(func, names[i]); - else - func->arg_names[pos] = NULL; + char mode = modes ? modes[i] : PROARGMODE_IN; + switch (mode) { + case PROARGMODE_IN: + case PROARGMODE_INOUT: + type = plproxy_find_type_info(func, types[i], 1); + pos = func->arg_count++; + func->arg_types[pos] = type; + if (names && names[i]) + func->arg_names[pos] = plproxy_func_strdup(func, names[i]); + else + func->arg_names[pos] = NULL; + break; + case PROARGMODE_VARIADIC: + elog(ERROR, "PL/Proxy does not support variadic args"); + break; + case PROARGMODE_OUT: + case PROARGMODE_TABLE: + /* output args, ignore */ + break; + default: + elog(ERROR, "PL/Proxy: unknown value in proargmodes: %c", mode); + break; + } } } diff --git a/src/plproxy.h b/src/plproxy.h index da9b9d4..38185bd 100644 --- a/src/plproxy.h +++ b/src/plproxy.h @@ -96,6 +96,26 @@ #endif /* + * backwards compat with 8.4 + */ +#ifndef PROARGMODE_IN +#define PROARGMODE_IN 'i' +#endif +#ifndef PROARGMODE_OUT +#define PROARGMODE_OUT 'o' +#endif +#ifndef PROARGMODE_INOUT +#define PROARGMODE_INOUT 'b' +#endif +#ifndef PROARGMODE_VARIADIC +#define PROARGMODE_VARIADIC 'v' +#endif +#ifndef PROARGMODE_TABLE +#define PROARGMODE_TABLE 't' +#endif + + +/* * Determine if this argument is to SPLIT */ #define IS_SPLIT_ARG(func, arg) ((func)->split_args && (func)->split_args[arg]) |
