From 27dc7e240bfd230ee1315cc00577a6ed72aff94a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 24 Mar 2011 20:30:14 -0400 Subject: Fix handling of collation in SQL-language functions. Ensure that parameter symbols receive collation from the function's resolved input collation, and fix inlining to behave properly. BTW, this commit lays about 90% of the infrastructure needed to support use of argument names in SQL functions. Parsing of parameters is now done via the parser-hook infrastructure ... we'd just need to supply a column-ref hook ... --- src/backend/parser/parse_param.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/backend/parser/parse_param.c') diff --git a/src/backend/parser/parse_param.c b/src/backend/parser/parse_param.c index 1cf255669ac..1895f92d7c4 100644 --- a/src/backend/parser/parse_param.c +++ b/src/backend/parser/parse_param.c @@ -231,6 +231,11 @@ variable_coerce_param_hook(ParseState *pstate, Param *param, */ param->paramtypmod = -1; + /* + * This module always sets a Param's collation to be the default for + * its datatype. If that's not what you want, you should be using + * the more general parser substitution hooks. + */ param->paramcollid = get_typcollation(param->paramtype); /* Use the leftmost of the param's and coercion's locations */ -- cgit v1.2.3