diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-10-26 21:38:24 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-10-26 21:38:24 +0000 |
commit | 2f35b4efdbec6c161ca9bd491d6345134910c425 (patch) | |
tree | 2424351bcc12a8ddf2b716b28f53d2c37c79e507 /src/backend/nodes/outfuncs.c | |
parent | c9476bafdb1b97d0d21d92788f93298962145479 (diff) | |
download | postgresql-2f35b4efdbec6c161ca9bd491d6345134910c425.tar.gz |
Re-implement LIMIT/OFFSET as a plan node type, instead of a hack in
ExecutorRun. This allows LIMIT to work in a view. Also, LIMIT in a
cursor declaration will behave in a reasonable fashion, whereas before
it was overridden by the FETCH count.
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index cf8c90ecad..16b6485109 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.128 2000/10/05 19:11:27 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.129 2000/10/26 21:35:48 tgl Exp $ * * NOTES * Every (plan) node in POSTGRES has an associated "out" routine which @@ -623,6 +623,18 @@ _outSetOp(StringInfo str, SetOp *node) (int) node->flagColIdx); } +static void +_outLimit(StringInfo str, Limit *node) +{ + appendStringInfo(str, " LIMIT "); + _outPlanInfo(str, (Plan *) node); + + appendStringInfo(str, " :limitOffset "); + _outNode(str, node->limitOffset); + appendStringInfo(str, " :limitCount "); + _outNode(str, node->limitCount); +} + /* * Hash is a subclass of Plan */ @@ -1559,6 +1571,9 @@ _outNode(StringInfo str, void *obj) case T_SetOp: _outSetOp(str, obj); break; + case T_Limit: + _outLimit(str, obj); + break; case T_Hash: _outHash(str, obj); break; |