diff options
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 7ab3985f3e7..70dfe9706bc 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * back to source text * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.66 2000/10/05 21:52:08 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.67 2000/10/26 21:37:45 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -886,8 +886,8 @@ get_select_query_def(Query *query, deparse_context *context) /* ---------- * If the Query node has a setOperations tree, then it's the top - * level of a UNION/INTERSECT/EXCEPT query; only the ORDER BY field - * is interesting in the top query itself. + * level of a UNION/INTERSECT/EXCEPT query; only the ORDER BY and + * LIMIT fields are interesting in the top query itself. * ---------- */ if (query->setOperations) @@ -931,6 +931,18 @@ get_select_query_def(Query *query, deparse_context *context) sep = ", "; } } + + /* Add the LIMIT clause if given */ + if (query->limitOffset != NULL) + { + appendStringInfo(buf, " OFFSET "); + get_rule_expr(query->limitOffset, context); + } + if (query->limitCount != NULL) + { + appendStringInfo(buf, " LIMIT "); + get_rule_expr(query->limitCount, context); + } } static void |