Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id A4DB618FE98B for ; Thu, 1 Dec 2011 17:33:16 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWEFn-0004qp-0a for pgsql-bugs@postgresql.org; Thu, 01 Dec 2011 21:33:16 +0000 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 pB1LWwZN016386; Thu, 1 Dec 2011 16:32:58 -0500 (EST) To: Boszormenyi Zoltan cc: pgsql-bugs@postgresql.org, rep.dot.nop@gmail.com Subject: Re: BUG #6315: FETCH NEXT :next ROWS ONLY fails In-reply-to: <4ED7E66D.9090701@cybertec.at> References: <4ED7E66D.9090701@cybertec.at> Comments: In-reply-to Boszormenyi Zoltan message dated "Thu, 01 Dec 2011 21:41:17 +0100" Date: Thu, 01 Dec 2011 16:32:58 -0500 Message-ID: <16385.1322775178@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201112/15 X-Sequence-Number: 31826 Boszormenyi Zoltan writes: > 2011-12-01 20:09 keltezéssel, rep.dot.nop@gmail.com írta: >> Binding for "OFFSET :offset" works fine but binding for a "FETCH NEXT :next >> ROWS ONLY" raises: >> syntax error at or near "$2" >> 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