pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Boszormenyi Zoltan <zb@cybertec.at>
Cc: pgsql-bugs@postgresql.org
Cc: rep.dot.nop@gmail.com
Subject: Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails
Date: Thu, 01 Dec 2011 16:32:58 -0500
Message-ID: <16385.1322775178@sss.pgh.pa.us> (raw)
In-Reply-To: <4ED7E66D.9090701@cybertec.at>
References: <E1RWC0F-0000xy-Bh@wrigleys.postgresql.org>
	<4ED7E66D.9090701@cybertec.at>

Boszormenyi Zoltan <zb@cybertec.at> writes:
> 2011-12-01 20:09 keltezéssel, rep.dot.nop@gmail.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



view thread (6+ messages)  latest in thread

Message-ID: <16385.1322775178@sss.pgh.pa.us>
Permalink:  ../16385.1322775178@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16385.1322775178@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, zb@cybertec.at, rep.dot.nop@gmail.com
  Subject: Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails
  In-Reply-To: <16385.1322775178@sss.pgh.pa.us>
  References: <E1RWC0F-0000xy-Bh@wrigleys.postgresql.org> <4ED7E66D.9090701@cybertec.at> <16385.1322775178@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox