Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
Cc: pgsql-bugs(at)postgresql(dot)org, rep(dot)dot(dot)nop(at)gmail(dot)com
Subject: Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails
Date: 2011-12-01 21:32:58
Message-ID: 16385.1322775178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
> 2011-12-01 20:09 keltezssel, rep(dot)dot(dot)nop(at)gmail(dot)com rta:
>> Binding for &quot;OFFSET :offset&quot; works fine but binding for a &quot;FETCH NEXT :next
>> ROWS ONLY&quot; raises:
>> syntax error at or near &quot;$2&quot;
>> SELECT * FROM foo OFFSET $1 ROWS FETCH NEXT $2 ROWS ONLY

> This is not a supported syntax. Consider using
> SELECT * FROM foo OFFSET $1 LIMIT $2
> instead.

Well, actually it is supported, but you missed the fine print where it
says that you have to add parentheses if the offset or count isn't a
simple integer constant. I'll apply a patch to make that a bit more
obvious.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2011-12-01 21:50:38 Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails
Previous Message Boszormenyi Zoltan 2011-12-01 20:41:17 Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails