pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: dodobas@geoinfo.geof.hr
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
Date: Thu, 26 Apr 2012 11:52:06 -0500
Message-ID: <4F9936E602000025000473F2@gw.wicourts.gov> (raw)
In-Reply-To: <E1SNR9B-0001iZ-OE@wrigleys.postgresql.org>
References: <E1SNR9B-0001iZ-OE@wrigleys.postgresql.org>

<dodobas@geoinfo.geof.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



view thread (2+ messages)

Message-ID: <4F9936E602000025000473F2@gw.wicourts.gov>
Permalink:  ../4F9936E602000025000473F2@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4F9936E602000025000473F2@gw.wicourts.gov

 · 

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: Kevin.Grittner@wicourts.gov, dodobas@geoinfo.geof.hr
  Subject: Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
  In-Reply-To: <4F9936E602000025000473F2@gw.wicourts.gov>
  References: <E1SNR9B-0001iZ-OE@wrigleys.postgresql.org> <4F9936E602000025000473F2@gw.wicourts.gov>

* 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