FOR vs Cursors

Started by Lane Van Ingenabout 21 years ago2 messagesgeneral
Jump to latest
#1Lane Van Ingen
lvaningen@esncc.com

After reading the manual (8.0). I am not certain what real advantage there is to using a cursor
over using a FOR loop. since FOR automatically uses a cursor anyway. They both avoid
memory problems. Have I missed something or are there other reasons?

#2Sim Zacks
sim@nospam.com
In reply to: Lane Van Ingen (#1)
Re: FOR vs Cursors

One advantage of a cursor over a for loop is that it makes your code more
portable.
It also allows you to bring existing code over without having to majorly
rewrite.

""Van Ingen, Lane"" <lvaningen@ESNCC.com> wrote in message
news:A3FF4275060B76459B5C08A64AE330C86A37@twmail.esncc.com...

After reading the manual (8.0). I am not certain what real advantage there

is to using a cursor

over using a FOR loop. since FOR automatically uses a cursor anyway. They

both avoid

Show quoted text

memory problems. Have I missed something or are there other reasons?

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)