Re: CURSOR OR OFFSET/LIMIT

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: CURSOR OR OFFSET/LIMIT
Дата
Msg-id E64B184B-0661-461D-A478-904FCBA00F24@pgedit.com
обсуждение исходный текст
Ответ на CURSOR OR OFFSET/LIMIT  (Kaloyan Iliev <news1@faith.digsys.bg>)
Список pgsql-performance
On Apr 6, 2006, at 10:48 AM, Kaloyan Iliev wrote:

> If I use cursors it's better but my problem is that cursors live
> only in the current transaction.
> So when the Web Server finish I've lost the transaction and the
> cursor.


Cursors can live outside the transaction if you declare them WITH
HOLD specified. But that still may not help you in a web environment
if you want to break the results into pages served on separate
requests (and possibly different connections).

http://www.postgresql.org/docs/8.1/interactive/sql-declare.html

> Is there a way to save the cursor between separe Browser request
> (and to give it time to live)?

Sure, but you need to add a lot of connection management to do this.
You would need to keep track of the cursors and make sure a
subsequent request uses the right connection.






John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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

Предыдущее
От: Ragnar
Дата:
Сообщение: Re: Query planner is using wrong index.
Следующее
От: "Jignesh K. Shah"
Дата:
Сообщение: Re: Sun Fire T2000 and PostgreSQL 8.1.3