mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user