pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
2+ messages / 2 participants
[nested] [flat]

* BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
@ 2012-04-26 16:02 dodobas@geoinfo.geof.hr
  2012-04-26 16:52 ` Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 2+ messages in thread

From: dodobas@geoinfo.geof.hr @ 2012-04-26 16:02 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6617
Logged by:          Dražen Odobašić
Email address:      dodobas@geoinfo.geof.hr
PostgreSQL version: 9.1.3
Operating system:   Linux 3.3.3
Description:        

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) 

Bug example: https://pgsql.privatepaste.com/1e3ef786a5




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
  2012-04-26 16:02 BUG #6617: FETCH FIRST syntax accepts only constants and not parameters dodobas@geoinfo.geof.hr
@ 2012-04-26 16:52 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 2+ messages in thread

From: Kevin Grittner @ 2012-04-26 16:52 UTC (permalink / raw)
  To: dodobas@geoinfo.geof.hr; pgsql-bugs

<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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-04-26 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 16:02 BUG #6617: FETCH FIRST syntax accepts only constants and not parameters dodobas@geoinfo.geof.hr
2012-04-26 16:52 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

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