Skip site navigation (1) Skip section navigation (2)

incorrect syntax for offset

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: incorrect syntax for offset
Date: 2009-08-18 22:08:01
Message-ID: 3073cc9b0908181508n766464b7jffab0fa3977299e5@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-docs
Hi.

Our current docs says that we support the following syntax (i'm
putting just the lines that disturbes me) inside a SELECT statement
"""
[ LIMIT { count | ALL } ]
[ OFFSET start [ ROW | ROWS ] ]
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
"""

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;
                                    ^
-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

Responses

pgsql-docs by date

Next:From: Tom LaneDate: 2009-08-18 22:56:39
Subject: Re: incorrect syntax for offset
Previous:From: Andreas WenkDate: 2009-08-17 16:15:21
Subject: Re: wording for 38.6.2.4. Simple CASE and 38.6.2.5. Searched CASE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group