Re: sql query cursor problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sql query cursor problem
Дата
Msg-id 15634.994804101@sss.pgh.pa.us
обсуждение исходный текст
Ответ на sql query cursor problem  (Risko Peter <risko.peter@mhc.hu>)
Список pgsql-bugs
Risko Peter <risko.peter@mhc.hu> writes:
> It seems we've found a bug in PostgreSQL handling of cursored queries.
>   I assume that it's legal to do 'fetch backward all in xxx' and then
> 'fetch 1 in xxx' afterwards.

Backwards scan doesn't work right for any but the simplest sorts of
queries (no joins, no grouping or aggregation, probably some other
issues).  It'd be nice to fix it, but it's not very high on anyone's
priority list.  There are workarounds available, one of the simplest
being to specify ORDER BY --- the result of a sort step *can* be scanned
backwards, IIRC.  Use EXPLAIN to make sure your query has a Sort at
the top level.

            regards, tom lane

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

Предыдущее
От: Carl Anderson
Дата:
Сообщение: shared library compile error
Следующее
От: Benoit Lion
Дата:
Сообщение: order by and union