diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-12-31 00:08:39 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-12-31 00:08:39 +0000 |
| commit | 8e8854daa2b4b3ef9e3fc1a56c79608a70018058 (patch) | |
| tree | a6c4cf4b43acc764a38071843c10dc3edb3ca32e /src/backend/nodes/outfuncs.c | |
| parent | 0fb9be7acfb31ba38c1bbdd7883d5d03f6e261e5 (diff) | |
| download | postgresql-8e8854daa2b4b3ef9e3fc1a56c79608a70018058.tar.gz | |
Add some basic support for window frame clauses to the window-functions
patch. This includes the ability to force the frame to cover the whole
partition, and the ability to make the frame end exactly on the current row
rather than its last ORDER BY peer. Supporting any more of the full SQL
frame-clause syntax will require nontrivial hacking on the window aggregate
code, so it'll have to wait for 8.5 or beyond.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
| -rw-r--r-- | src/backend/nodes/outfuncs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index f926f1314c..5ece924e79 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.347 2008/12/28 18:53:56 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.348 2008/12/31 00:08:36 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -575,6 +575,7 @@ _outWindowAgg(StringInfo str, WindowAgg *node) _outPlanInfo(str, (Plan *) node); + WRITE_UINT_FIELD(winref); WRITE_INT_FIELD(partNumCols); appendStringInfo(str, " :partColIdx"); @@ -594,6 +595,8 @@ _outWindowAgg(StringInfo str, WindowAgg *node) appendStringInfo(str, " :ordOperations"); for (i = 0; i < node->ordNumCols; i++) appendStringInfo(str, " %u", node->ordOperators[i]); + + WRITE_INT_FIELD(frameOptions); } static void @@ -1953,6 +1956,7 @@ _outWindowClause(StringInfo str, WindowClause *node) WRITE_STRING_FIELD(refname); WRITE_NODE_FIELD(partitionClause); WRITE_NODE_FIELD(orderClause); + WRITE_INT_FIELD(frameOptions); WRITE_UINT_FIELD(winref); WRITE_BOOL_FIELD(copiedOrder); } @@ -2242,6 +2246,7 @@ _outWindowDef(StringInfo str, WindowDef *node) WRITE_STRING_FIELD(refname); WRITE_NODE_FIELD(partitionClause); WRITE_NODE_FIELD(orderClause); + WRITE_INT_FIELD(frameOptions); WRITE_LOCATION_FIELD(location); } |
