diff options
| author | Tom Lane | 2008-03-20 21:42:48 +0000 |
|---|---|---|
| committer | Tom Lane | 2008-03-20 21:42:48 +0000 |
| commit | 6b0706ac33ab5da815980c642a9cde9a4cd86b6b (patch) | |
| tree | 511ad4743ad55a095cbacea0713b437af36ba9ce /src/include | |
| parent | 8759b79d0fe8b9937b7cbebfed78480b3e6a94b2 (diff) | |
Arrange for an explicit cast applied to an ARRAY[] constructor to be applied
directly to all the member expressions, instead of the previous implementation
where the ARRAY[] constructor would infer a common element type and then we'd
coerce the finished array after the fact. This has a number of benefits,
one being that we can allow an empty ARRAY[] construct so long as its
element type is specified by such a cast.
Brendan Jurd, minor fixes by me.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/nodes.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 17 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 5a6745a214..79d679b5be 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.205 2008/01/01 19:45:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.206 2008/03/20 21:42:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -324,6 +324,7 @@ typedef enum NodeTag T_FuncCall, T_A_Indices, T_A_Indirection, + T_A_ArrayExpr, T_ResTarget, T_TypeCast, T_SortBy, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index c973eea729..ff01438331 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.359 2008/02/07 17:09:51 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.360 2008/03/20 21:42:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -242,9 +242,9 @@ typedef struct A_Const * TypeCast - a CAST expression * * NOTE: for mostly historical reasons, A_Const parsenodes contain - * room for a TypeName; we only generate a separate TypeCast node if the - * argument to be casted is not a constant. In theory either representation - * would work, but the combined representation saves a bit of code in many + * room for a TypeName, allowing a constant to be marked as being of a given + * type without a separate TypeCast node. Either representation will work, + * but the combined representation saves a bit of code in many * productions in gram.y. */ typedef struct TypeCast @@ -305,6 +305,15 @@ typedef struct A_Indirection } A_Indirection; /* + * A_ArrayExpr - an ARRAY[] construct + */ +typedef struct A_ArrayExpr +{ + NodeTag type; + List *elements; /* array element expressions */ +} A_ArrayExpr; + +/* * ResTarget - * result target (used in target list of pre-transformed parse trees) * |
