1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +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:
Tom Lane
2011-03-11 16:27:51 -05:00
parent 7a8f43968a
commit 8acdb8bf9c
22 changed files with 298 additions and 139 deletions

View File

@ -1195,6 +1195,16 @@ _outConvertRowtypeExpr(StringInfo str, ConvertRowtypeExpr *node)
WRITE_LOCATION_FIELD(location);
}
static void
_outCollateExpr(StringInfo str, CollateExpr *node)
{
WRITE_NODE_TYPE("COLLATE");
WRITE_NODE_FIELD(arg);
WRITE_OID_FIELD(collOid);
WRITE_LOCATION_FIELD(location);
}
static void
_outCaseExpr(StringInfo str, CaseExpr *node)
{
@ -2104,11 +2114,10 @@ _outTypeCast(StringInfo str, TypeCast *node)
static void
_outCollateClause(StringInfo str, CollateClause *node)
{
WRITE_NODE_TYPE("COLLATE");
WRITE_NODE_TYPE("COLLATECLAUSE");
WRITE_NODE_FIELD(arg);
WRITE_NODE_FIELD(collnames);
WRITE_OID_FIELD(collOid);
WRITE_NODE_FIELD(collname);
WRITE_LOCATION_FIELD(location);
}
@ -2829,9 +2838,6 @@ _outNode(StringInfo str, void *obj)
case T_RelabelType:
_outRelabelType(str, obj);
break;
case T_CollateClause:
_outCollateClause(str, obj);
break;
case T_CoerceViaIO:
_outCoerceViaIO(str, obj);
break;
@ -2841,6 +2847,9 @@ _outNode(StringInfo str, void *obj)
case T_ConvertRowtypeExpr:
_outConvertRowtypeExpr(str, obj);
break;
case T_CollateExpr:
_outCollateExpr(str, obj);
break;
case T_CaseExpr:
_outCaseExpr(str, obj);
break;
@ -3020,6 +3029,9 @@ _outNode(StringInfo str, void *obj)
case T_TypeCast:
_outTypeCast(str, obj);
break;
case T_CollateClause:
_outCollateClause(str, obj);
break;
case T_IndexElem:
_outIndexElem(str, obj);
break;