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

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
Дата
Msg-id 4F9936E602000025000473F2@gw.wicourts.gov
обсуждение исходный текст
Ответ на BUG #6617: FETCH FIRST syntax accepts only constants and not parameters  (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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: dodobas@geoinfo.geof.hr
Дата:
Сообщение: BUG #6617: FETCH FIRST syntax accepts only constants and not parameters
Следующее
От: Josh Berkus
Дата:
Сообщение: 291 pg_toast_temp schemas?