Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r46hU-007NTj-2A for pgsql-docs@arkaria.postgresql.org; Fri, 17 Nov 2023 21:48:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r46hS-00GRUx-NT for pgsql-docs@arkaria.postgresql.org; Fri, 17 Nov 2023 21:48:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r46hS-00GRUp-Fe for pgsql-docs@lists.postgresql.org; Fri, 17 Nov 2023 21:48:30 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r46hO-006y00-4O for pgsql-docs@lists.postgresql.org; Fri, 17 Nov 2023 21:48:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=JXyY2CRmxySRh5dX9xft/bhiNX401VOXoSJS65zjM7M=; b=iXRNy yLYzVYRj0plA1gQO+0BpZjQdGuf7fJYXZbg+oIHPr7/TMPNCHAco2u7sp4JwIQFajI7cB5Y4+XDtN wtB0IGtASAqvXKn8aCOULsN1tBvPiChTvm5s05dWRfZW16nW/q3PdI+fHW+X8V+hdL9sqfPR0QEby qBhwrNDEKY/hguZi1OwqtMsDxLi3sRBaBo7vHBEtQCPfD7QhFzIg/aBCZdTEKRdrHL2ZOzxAlfWaa jNstULzFJKupoH0IXUsnKGoNasP+4Vwe3LH3D7Ch0tDEXQ2nUvaGgMt7zjOIj9qofEPIfU4Vq4vTQ UER3Uq3UjsvhBwGifS5cGYggXd63Q==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1r46hL-00BX8k-0t; Fri, 17 Nov 2023 16:48:23 -0500 Date: Fri, 17 Nov 2023 16:48:23 -0500 From: Bruce Momjian To: Euler Taveira Cc: spam_eater@gmx.net, pgsql-docs@lists.postgresql.org Subject: Re: Missing documentation for FETCH FIRST in chapter 7.6 Message-ID: References: <152647693295.27207.7601447066719718827@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sCbqQ3hYpW3yTfuQ" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --sCbqQ3hYpW3yTfuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jun 13, 2018 at 04:17:55PM -0300, Euler Taveira wrote: > 2018-05-16 10:22 GMT-03:00 PG Doc comments form : > > The documentation of the SELECT statement lists FETCH FIRST/OFFSET as an > > alternative to the proprietary LIMIT clause. > > > > https://www.postgresql.org/docs/current/static/sql-select.html#SQL-LIMIT > > > > However, chapter 7.6 about LIMIT/OFFSET does not mention the alternative. > > > > https://www.postgresql.org/docs/current/static/queries-limit.html > > > Make sense. I propose the attached patch that adds a link to the LIMIT > section in the SELECT reference page. I also renamed the "number" > variables to the same names used in the SELECT reference page and put > OFFSET in a new line (it looks visually better). I applied the attached patch based on your patch to master. Thanks. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --sCbqQ3hYpW3yTfuQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="limit.diff" commit 8127e6e8ad Author: Bruce Momjian Date: Fri Nov 17 16:46:43 2023 -0500 doc: update query section to show LIMIT/OFFSET like SELECT The parameter names were slightly better in SELECT, so make them match. Reported-by: Euler Taveira Discussion: https://postgr.es/m/CAHE3wgh-EYuAbLG1VS3QTHii1TgWS31h-fYEgrdda7oTOuskOQ@mail.gmail.com Backpatch-through: master diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index 8a4674e5f2..648b283b06 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -1912,7 +1912,8 @@ SELECT a + b AS sum, c FROM table1 ORDER BY sum + c; -- wrong SELECT select_list FROM table_expression ORDER BY ... - LIMIT { number | ALL } OFFSET number + LIMIT { count | ALL } + OFFSET start --sCbqQ3hYpW3yTfuQ--