Обсуждение: Cursor names

Поиск
Список
Период
Сортировка

Cursor names

От
Nathaniel Trellice
Дата:
Hi all,

I'm using a cursor to read query results a few rows at a time. The syntax I'm using to 'create' the cursor is:

  DECLARE <cursor name> BINARY CURSOR FOR SELECT [rest of query];

followed by calls to

  FETCH FORWARD <num rows> FROM <cursor name>

and everything's working nicely.

My DB has multiple clients each of which may have multiple connections open the the DB (the client app is threaded),
allmaking cursored queries simultaneously. 

So my question is: what are the constraints on <cursor name>? Must each cursor name be unique amongst all declared
cursorsfrom all clients, or just unique within a single connection from a single client, or something else? 

Nathaniel





Re: Cursor names

От
Tom Lane
Дата:
Nathaniel Trellice <naptrel@yahoo.co.uk> writes:
> So my question is: what are the constraints on <cursor name>? Must each cursor name be unique amongst all declared
cursorsfrom all clients, or just unique within a single connection from a single client, or something else? 

Cursor names are local to a session.

            regards, tom lane