diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-22 21:05:16 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-22 21:05:29 -0500 |
commit | 6efbded6e4672c597a6f0dc0f09263e7db7369ff (patch) | |
tree | 2ee78e250058cdbc4021f24c6ae0bf4e92098c4b /src/include/nodes/parsenodes.h | |
parent | 0ba3f3bc65f1176250b942e14fd9e4975a5d3913 (diff) | |
download | postgresql-6efbded6e4672c597a6f0dc0f09263e7db7369ff.tar.gz postgresql-6efbded6e4672c597a6f0dc0f09263e7db7369ff.zip |
Allow omitting one or both boundaries in an array slice specifier.
Omitted boundaries represent the upper or lower limit of the corresponding
array subscript. This allows simpler specification of many common
use-cases.
(Revised version of commit 9246af6799819847faa33baf441251003acbb8fe)
YUriy Zhuravlev
Diffstat (limited to 'src/include/nodes/parsenodes.h')
-rw-r--r-- | src/include/nodes/parsenodes.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 9142e94b070..abd4dd166cc 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -157,9 +157,10 @@ typedef struct Query List *constraintDeps; /* a list of pg_constraint OIDs that the query * depends on to be semantically valid */ - List *withCheckOptions; /* a list of WithCheckOption's, which are - * only added during rewrite and therefore - * are not written out as part of Query. */ + List *withCheckOptions; /* a list of WithCheckOption's, which + * are only added during rewrite and + * therefore are not written out as + * part of Query. */ } Query; @@ -351,13 +352,17 @@ typedef struct A_Star } A_Star; /* - * A_Indices - array subscript or slice bounds ([lidx:uidx] or [uidx]) + * A_Indices - array subscript or slice bounds ([idx] or [lidx:uidx]) + * + * In slice case, either or both of lidx and uidx can be NULL (omitted). + * In non-slice case, uidx holds the single subscript and lidx is always NULL. */ typedef struct A_Indices { NodeTag type; - Node *lidx; /* NULL if it's a single subscript */ - Node *uidx; + bool is_slice; /* true if slice (i.e., colon present) */ + Node *lidx; /* slice lower bound, if any */ + Node *uidx; /* subscript, or slice upper bound if any */ } A_Indices; /* |