aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/parse_relation.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index d7c4bae8ccf..2e0c278f355 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -1781,8 +1781,11 @@ addRangeTableEntryForFunction(ParseState *pstate,
chooseScalarFunctionAlias(funcexpr, funcname,
alias, nfuncs),
funcrettype,
- -1,
+ exprTypmod(funcexpr),
0);
+ TupleDescInitEntryCollation(tupdesc,
+ (AttrNumber) 1,
+ exprCollation(funcexpr));
}
else if (functypclass == TYPEFUNC_RECORD)
{
@@ -1882,12 +1885,15 @@ addRangeTableEntryForFunction(ParseState *pstate,
/* Add the ordinality column if needed */
if (rangefunc->ordinality)
+ {
TupleDescInitEntry(tupdesc,
(AttrNumber) ++natts,
"ordinality",
INT8OID,
-1,
0);
+ /* no need to set collation */
+ }
Assert(natts == totalatts);
}