Subject: | Allow seeking over results |
From an email. Have not looked into how feasible this is:
" When working
in PHP with mysql or postgresql there is a function, e.g. pg_result_seek,
which allows random access seek over the tuple set. The underlying libpq
allows this. I don't see any equivalent method in DBD::Pg. I would prefer
not to use SQL cursors or the LIMIT/OFFSET hack.
So I wonder if it would be possible to add such a method, e.g.
$sth->result_seek($rownum); I see that dbd_st_fetch calls
PQgetvalue(imp_sth->result, imp_sth->cur_tuple, i); but there is no
accessible means of modifying imp_sth->cur_tuple, only a read-only attribute.
It would seem to me that a correct implementation of result_seek should
also turn ACTIVE_on if the new row number is < imp_sth->rows so that it is
possible to "rewind" the result stream, and it should fail if the row is
Show quoted text
>=imp_sth->rows"