aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-03-11 16:27:51 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-03-11 16:28:18 -0500
commit8acdb8bf9cebc42cee5aa96a2d594756b44173c9 (patch)
tree3db28ae99dfb962e4ac5f2f338a15d2b5c7a476e /src/backend/parser/parse_expr.c
parent7a8f43968add3c69b79c49ef236d945e643dcb1e (diff)
downloadpostgresql-8acdb8bf9cebc42cee5aa96a2d594756b44173c9.tar.gz
postgresql-8acdb8bf9cebc42cee5aa96a2d594756b44173c9.zip
Split CollateClause into separate raw and analyzed node types.
CollateClause is now used only in raw grammar output, and CollateExpr after parse analysis. This is for clarity and to avoid carrying collation names in post-analysis parse trees: that's both wasteful and possibly misleading, since the collation's name could be changed while the parsetree still exists. Also, clean up assorted infelicities and omissions in processing of the node type.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r--src/backend/parser/parse_expr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index 7a4f8cc2497..17bd2bf50ae 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -318,6 +318,7 @@ transformExpr(ParseState *pstate, Node *expr)
case T_CoerceViaIO:
case T_ArrayCoerceExpr:
case T_ConvertRowtypeExpr:
+ case T_CollateExpr:
case T_CaseTestExpr:
case T_ArrayExpr:
case T_CoerceToDomain:
@@ -2103,11 +2104,11 @@ transformTypeCast(ParseState *pstate, TypeCast *tc)
static Node *
transformCollateClause(ParseState *pstate, CollateClause *c)
{
- CollateClause *newc;
+ CollateExpr *newc;
Oid argtype;
- newc = makeNode(CollateClause);
- newc->arg = (Expr *) transformExpr(pstate, (Node *) c->arg);
+ newc = makeNode(CollateExpr);
+ newc->arg = (Expr *) transformExpr(pstate, c->arg);
argtype = exprType((Node *) newc->arg);
/*
@@ -2121,8 +2122,7 @@ transformCollateClause(ParseState *pstate, CollateClause *c)
format_type_be(argtype)),
parser_errposition(pstate, c->location)));
- newc->collOid = LookupCollation(pstate, c->collnames, c->location);
- newc->collnames = c->collnames;
+ newc->collOid = LookupCollation(pstate, c->collname, c->location);
newc->location = c->location;
return (Node *) newc;