Forum: Ruby on Rails ActiveRecord and Cursors (with PostgreSQL)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B9f28a2235697025ebfcebb81575a6b8?d=identicon&s=25 Allen Fair (Guest)
on 2006-01-10 00:05
(Received via mailing list)
Hi,

Is there a way to access database cursors using Rails, preferably
through ActiveRecord? I believe the standard usage loads the entire
result set into memory. However, for extremely large results (or when I
don't want to abuse memory levels), this is sometimes not possible.

While it may not be feasible for a web application to process huge
amounts of data, I want to run this as an asynchronous task, "cron" task
or similar.

I recently encountered this problem with my Perl application returning a
large result set from PostgreSQL. The solution was to execute 'define
cursor' and 'fetch 1000' commands, with the fetch methods. I hope to
port this application or feature to Ruby on Rails.

Thanks,
Allen
This topic is locked and can not be replied to.