Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C3836633A15 for ; Tue, 18 Aug 2009 19:56:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 96356-03 for ; Tue, 18 Aug 2009 22:56:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C7F9163370C for ; Tue, 18 Aug 2009 19:56:41 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n7IMueYD006424; Tue, 18 Aug 2009 18:56:40 -0400 (EDT) To: Jaime Casanova cc: pgsql-docs Subject: Re: incorrect syntax for offset In-reply-to: <3073cc9b0908181508n766464b7jffab0fa3977299e5@mail.gmail.com> References: <3073cc9b0908181508n766464b7jffab0fa3977299e5@mail.gmail.com> Comments: In-reply-to Jaime Casanova message dated "Tue, 18 Aug 2009 17:08:01 -0500" Date: Tue, 18 Aug 2009 18:56:39 -0400 Message-ID: <6423.1250636199@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=AWL=0.000, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/33 X-Sequence-Number: 5251 Jaime Casanova writes: > i read that as allow me to use the ROWS in an OFFSET clause whatever i > use LIMIT or FETCH for limiting results but seems like we try hard to > make a distinguish from old syntax and new (sql standard) syntax > pruebas=# select * from tab1 limit 3 offset 2 rows; > ERROR: syntax error at or near "rows" > LINE 1: select * from tab1 limit 3 offset 2 rows; > ^ > pruebas=# select * from tab1 offset 2 fetch next 3 rows only; > ERROR: syntax error at or near "fetch" > LINE 1: select * from tab1 offset 2 fetch next 3 rows only; Hmm. Seems like we could refactor the select_limit production so it actually allows all the reasonable combinations. Let me have a look... regards, tom lane