We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

PDO Support for scrollable cursors

At the topof the documentation for phalcon pagination it states that "Since PDO doesn’t support scrollable cursors this adapter shouldn’t be used to paginate a large number of records".

Could someone please clarify on this because as far as i am aware postgres (which I am using) DOES support scrollable cursors. As such i cannot see why there would be any memory issues with large data sets.

I have not looked into the internals of pagination, but I can only assume the cursor is moved to the necessary point and then moves forward for the respective number of items per page defined.

Thanks Thomas

edited Jul '14

The MySQL driver that has support via the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, but you don't have a generic way of doing it with all db drivers.

It's possible with PDO, by declaring coursors as described here by Anthony: https://agentile.com/postgres-cursors-and-php .


You can use the QueryBuilder paginator which use a LIMIT/OFFSET clause to avoid that problem: https://docs.phalcon.io/en/latest/reference/pagination.html#adapters-usage

My question is moreso what is the problem?

My understanding of postgres is that there should be no need for the above solutions. Thanks