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

Re: incorrect syntax for offset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: incorrect syntax for offset
Date: 2009-08-18 22:56:39
Message-ID: 6423.1250636199@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-docs
Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> 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

In response to

pgsql-docs by date

Next:From: Bruno GuimarĂ£es CarneiroDate: 2009-08-21 11:53:38
Subject: Doc 8.4 Part 2 - Cap 6 : Data Manipulation ( about Triggers and Rewrite Rules )
Previous:From: Jaime CasanovaDate: 2009-08-18 22:08:01
Subject: incorrect syntax for offset

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