mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Create a new parsetree node type, TypeCast, so that transformation of
SQL cast constructs can be performed during expression transformation instead of during parsing. This allows constructs like x::numeric(9,2) and x::int2::float8 to behave as one would expect.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.99 2000/01/09 00:26:22 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.100 2000/01/17 00:14:46 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1385,6 +1385,17 @@ _copyTypeName(TypeName *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static TypeCast *
|
||||
_copyTypeCast(TypeCast *from)
|
||||
{
|
||||
TypeCast *newnode = makeNode(TypeCast);
|
||||
|
||||
Node_Copy(from, newnode, arg);
|
||||
Node_Copy(from, newnode, typename);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static Query *
|
||||
_copyQuery(Query *from)
|
||||
{
|
||||
@ -1658,6 +1669,9 @@ copyObject(void *from)
|
||||
case T_TypeName:
|
||||
retval = _copyTypeName(from);
|
||||
break;
|
||||
case T_TypeCast:
|
||||
retval = _copyTypeCast(from);
|
||||
break;
|
||||
|
||||
/*
|
||||
* VALUE NODES
|
||||
|
Reference in New Issue
Block a user