summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_node.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/parser/parse_node.c
parent8009c275925dda90f1275ba70f5c2a63abaa520b (diff)
downloadpostgresql-5cabcfccce4b8b826c9b30828f3012b7926a6946.tar.gz
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/parser/parse_node.c')
-rw-r--r--src/backend/parser/parse_node.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 652ab54d2a..33ee300fb2 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.66 2002/06/20 20:29:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.67 2002/08/26 17:53:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -343,11 +343,12 @@ transformArraySubscripts(ParseState *pstate,
* Ready to build the ArrayRef node.
*/
aref = makeNode(ArrayRef);
+ aref->refrestype = resultType; /* XXX should save element type
+ * too */
aref->refattrlength = type_struct_array->typlen;
aref->refelemlength = type_struct_element->typlen;
- aref->refelemtype = resultType; /* XXX should save element type
- * too */
aref->refelembyval = type_struct_element->typbyval;
+ aref->refelemalign = type_struct_element->typalign;
aref->refupperindexpr = upperIndexpr;
aref->reflowerindexpr = lowerIndexpr;
aref->refexpr = arrayBase;