Parameters don't work in FETCH NEXT clause?

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема Parameters don't work in FETCH NEXT clause?
Дата
Msg-id CADT4RqBmMaPM03QrZ0w0MqQkxNpRg07FnyQWpCD0j9NSbzAo9Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Parameters don't work in FETCH NEXT clause?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
A user of mine just raised a strange issue... While it is possible to use a parameter in a LIMIT clause, PostgreSQL does not seem to allow using one in a FETCH NEXT clause. In other words, while the following works:

SELECT 1 LIMIT $1;

The following generates a syntax error:

SELECT 1 FETCH NEXT $1 ROWS ONLY;

Since LIMIT and FETCH NEXT are supposed to be equivalent this behavior is odd.

More generally, is there some documentation on where exactly PostgreSQL allows parameters and where it doesn't? I occasionally get complaints from users expecting parameters to work in DDL, or even in table/column names in SELECT queries... I haven't seen a resource like this.

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Backup doc typo
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API