<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