mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
First phase of work on array improvements. ARRAY[x,y,z] constructor
expressions, ARRAY(sub-SELECT) expressions, some array functions. Polymorphic functions using ANYARRAY/ANYELEMENT argument and return types. Some regression tests in place, documentation is lacking. Joe Conway, with some kibitzing from Tom Lane.
This commit is contained in:
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.247 2003/03/20 07:02:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.248 2003/04/08 23:20:01 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -738,10 +738,8 @@ _copyArrayRef(ArrayRef *from)
|
||||
ArrayRef *newnode = makeNode(ArrayRef);
|
||||
|
||||
COPY_SCALAR_FIELD(refrestype);
|
||||
COPY_SCALAR_FIELD(refattrlength);
|
||||
COPY_SCALAR_FIELD(refelemlength);
|
||||
COPY_SCALAR_FIELD(refelembyval);
|
||||
COPY_SCALAR_FIELD(refelemalign);
|
||||
COPY_SCALAR_FIELD(refarraytype);
|
||||
COPY_SCALAR_FIELD(refelemtype);
|
||||
COPY_NODE_FIELD(refupperindexpr);
|
||||
COPY_NODE_FIELD(reflowerindexpr);
|
||||
COPY_NODE_FIELD(refexpr);
|
||||
@ -919,6 +917,22 @@ _copyCaseWhen(CaseWhen *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyArrayExpr
|
||||
*/
|
||||
static ArrayExpr *
|
||||
_copyArrayExpr(ArrayExpr *from)
|
||||
{
|
||||
ArrayExpr *newnode = makeNode(ArrayExpr);
|
||||
|
||||
COPY_SCALAR_FIELD(array_typeid);
|
||||
COPY_SCALAR_FIELD(element_typeid);
|
||||
COPY_NODE_FIELD(elements);
|
||||
COPY_SCALAR_FIELD(ndims);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
||||
/*
|
||||
* _copyCoalesceExpr
|
||||
*/
|
||||
@ -2537,6 +2551,9 @@ copyObject(void *from)
|
||||
case T_CaseWhen:
|
||||
retval = _copyCaseWhen(from);
|
||||
break;
|
||||
case T_ArrayExpr:
|
||||
retval = _copyArrayExpr(from);
|
||||
break;
|
||||
case T_CoalesceExpr:
|
||||
retval = _copyCoalesceExpr(from);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user