CURRENT OF cursor without OIDs

Поиск
Список
Период
Сортировка
От Ian Lance Taylor
Тема CURRENT OF cursor without OIDs
Дата
Msg-id siae1bkgj2.fsf@daffy.airs.com
обсуждение исходный текст
Ответы Re: CURRENT OF cursor without OIDs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Oracle PL/SQL supports a very convenient feature in which you can say
something like DECLARE   CURSUR cur IS SELECT * FROM RECORD; BEGIN   OPEN cur;   UPDATE record SET field = value WHERE
CURRENTOF cur;   CLOSE cur; END
 

We have cursors in the development version of PL/pgSQL, but they don't
support CURRENT OF.  In the patch I wrote a few months back to add
cursor support to PL/pgSQL, which was not adopted, I included support
for CURRENT OF.  I did it by using OIDs.  Within PL/pgSQL, I modified
the cursor select statement to also select the OID.  Then I change
WHERE CURRENT OF cur to oid = oidvalue.  Of course this only works in
limited situations, and in particular doesn't work after OID
wraparound.

Anyhow, I see that there is a move afoot to eliminate mandatory OIDs.
My question now is: if there is no OID, is there any comparable way to
implement CURRENT OF cursor?  Basically what is needed is some way to
identify a particular row between a SELECT and an UPDATE.

Ian


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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: OID wraparound: summary and proposal
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] Allow IDENT authentication on local connections (Linux only)