aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_param.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-03-24 20:30:14 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-03-24 20:30:23 -0400
commit27dc7e240bfd230ee1315cc00577a6ed72aff94a (patch)
tree2100db2f29740b01e27d679b6ac8eb2fc313a715 /src/backend/parser/parse_param.c
parenta432e2783bb69fb68461ed2bcc460e2876fcc68d (diff)
downloadpostgresql-27dc7e240bfd230ee1315cc00577a6ed72aff94a.tar.gz
postgresql-27dc7e240bfd230ee1315cc00577a6ed72aff94a.zip
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 ...
Diffstat (limited to 'src/backend/parser/parse_param.c')
-rw-r--r--src/backend/parser/parse_param.c5
1 files changed, 5 insertions, 0 deletions
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 */