diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-02 20:42:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-02-02 20:42:57 +0000 |
commit | c242502005bb0e89e55a2f1f68cc37b5480b50ad (patch) | |
tree | 5f26f7555fc1190a0bb47d51eea7bbe35505ba28 | |
parent | c401a5ce585d99e5533844bb616074e693cc77cf (diff) | |
download | postgresql-c242502005bb0e89e55a2f1f68cc37b5480b50ad.tar.gz postgresql-c242502005bb0e89e55a2f1f68cc37b5480b50ad.zip |
Document the longstanding behavior of LIMIT NULL and OFFSET NULL,
per gripe from David Wheeler that this was mentioned nowhere.
In passing, editorialize a bit on the description of the SQL:2008
equivalent syntax.
-rw-r--r-- | doc/src/sgml/ref/select.sgml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index a33a537bd48..ff5d6812604 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.119 2009/01/23 14:05:28 momjian Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/select.sgml,v 1.120 2009/02/02 20:42:57 tgl Exp $ PostgreSQL documentation --> @@ -1003,6 +1003,13 @@ OFFSET <replaceable class="parameter">start</replaceable> </para> <para> + If the <replaceable class="parameter">count</replaceable> expression + evaluates to NULL, it is treated as <literal>LIMIT ALL</>, i.e., no + limit. If <replaceable class="parameter">start</replaceable> evaluates + to NULL, it is treated the same as <literal>OFFSET 0</>. + </para> + + <para> SQL:2008 introduced a different syntax to achieve the same thing, which PostgreSQL also supports. It is: <synopsis> @@ -1014,10 +1021,11 @@ FETCH { FIRST | NEXT } [ <replaceable class="parameter">count</replaceable> ] { the <literal>FETCH</literal> clause. <literal>ROW</literal> and <literal>ROWS</literal> as well as <literal>FIRST</literal> and <literal>NEXT</literal> are noise words that don't influence - the effects of these clauses. When using expressions other than - constants for the offset or fetch count, parentheses will be - necessary in most cases. If the fetch count is omitted, it - defaults to 1. + the effects of these clauses. In this syntax, when using expressions + other than simple constants for <replaceable class="parameter">start</> + or <replaceable class="parameter">count</replaceable>, parentheses will be + necessary in most cases. If <replaceable class="parameter">count</> is + omitted in <literal>FETCH</>, it defaults to 1. </para> <para> |