summaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-26 17:54:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-26 17:54:02 +0000
commit5cabcfccce4b8b826c9b30828f3012b7926a6946 (patch)
tree3e14c0710a45b4195734dd3189eb89eac4969073 /src/backend/nodes/outfuncs.c
parent8009c275925dda90f1275ba70f5c2a63abaa520b (diff)
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.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 1a610b7c7c0..3a407753392 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.168 2002/08/19 15:08:46 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.169 2002/08/26 17:53:58 tgl Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -831,16 +831,18 @@ static void
_outArrayRef(StringInfo str, ArrayRef *node)
{
appendStringInfo(str,
- " ARRAYREF :refelemtype %u :refattrlength %d :refelemlength %d ",
- node->refelemtype,
+ " ARRAYREF :refrestype %u :refattrlength %d :refelemlength %d ",
+ node->refrestype,
node->refattrlength,
node->refelemlength);
- appendStringInfo(str, " :refelembyval %c :refupperindex ",
- node->refelembyval ? 't' : 'f');
+ appendStringInfo(str,
+ ":refelembyval %s :refelemalign %c :refupperindexpr ",
+ booltostr(node->refelembyval),
+ node->refelemalign);
_outNode(str, node->refupperindexpr);
- appendStringInfo(str, " :reflowerindex ");
+ appendStringInfo(str, " :reflowerindexpr ");
_outNode(str, node->reflowerindexpr);
appendStringInfo(str, " :refexpr ");