mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Modify array operations to include array's element type OID in the
array header, and to compute sizing and alignment of array elements the same way normal tuple access operations do --- viz, using the tupmacs.h macros att_addlength and att_align. This makes the world safe for arrays of cstrings or intervals, and should make it much easier to write array-type-polymorphic functions; as examples see the cleanups of array_out and contrib/array_iterator. By Joe Conway and 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.205 2002/08/24 15:00:46 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.206 2002/08/26 17:53:57 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1056,10 +1056,11 @@ _copyArrayRef(ArrayRef *from)
|
||||
/*
|
||||
* copy remainder of node
|
||||
*/
|
||||
newnode->refrestype = from->refrestype;
|
||||
newnode->refattrlength = from->refattrlength;
|
||||
newnode->refelemlength = from->refelemlength;
|
||||
newnode->refelemtype = from->refelemtype;
|
||||
newnode->refelembyval = from->refelembyval;
|
||||
newnode->refelemalign = from->refelemalign;
|
||||
|
||||
Node_Copy(from, newnode, refupperindexpr);
|
||||
Node_Copy(from, newnode, reflowerindexpr);
|
||||
|
Reference in New Issue
Block a user