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

Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <dodobas(at)geoinfo(dot)geof(dot)hr>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
Date: 2012-04-26 16:52:06
Message-ID: 4F9936E602000025000473F2@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-bugs
<dodobas(at)geoinfo(dot)geof(dot)hr> wrote:
 
> When tried setting FETCH FIRST parameter dynamically in RETURN
> QUERY EXECUTE some_query USING param1 it resulted with a syntax
> error on FETCH FIRST parameter.
> 
> Apparently, it only accepts constants so it works with ($1) 
 
That's not a bug.  Use the parentheses as specified in the
documentation:
 
http://www.postgresql.org/docs/9.1/interactive/sql-select.html#SQL-LIMIT
 
| to write anything except a simple integer constant for start or
| count, you must write parentheses around it.
 
-Kevin

In response to

pgsql-bugs by date

Next:From: Josh BerkusDate: 2012-04-26 17:34:48
Subject: 291 pg_toast_temp schemas?
Previous:From: dodobasDate: 2012-04-26 16:02:21
Subject: BUG #6617: FETCH FIRST syntax accepts only constants and notparameters

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