> > Inasmuch as PostgreSQL has a cursor concept, it would be most excelent > > if libdbd-pg-perl supported it. The current implementation becomes > > problematic when selecting large amounts of data. > > I somehow doubt that this wishlist is possible. DBD::Pg is an > implementation of DBI and if there's no cursor concept in DBI, then there > can't be a cursor concept in DBD::Pg.
Well, as I understand it the DBI defines CurosrName, but it is "Not supported by this driver." > What exactly do you expect and why is the current interface problematic? > Can you give precise examples? Well, I am not an expert on the matter, I just know that it is handled by many other databse interfaces. The problem, as explained in the module documentation is that because cursors are not supported "Hence the "execute" method fetches all data at once into data structures located in the front-end application." When dealing with very large databases, this can easily exhaust available memory. The module documentation suggests that the reason why cursors aren't supported is because PostgreSQL insists that they be used in transaction blocks, and "Because only one transaction block at a time is allowed, this would have implied the restriction not to use any nested 'SELECT' statements." Being in desperate need of cursors simply to perform a simple select from a very alrge database, rather than not implementing them at all, I would have liked to see the module make them available upon demand, and thus with the implied restrictions with respect to transactions. I don't know what the best way is to do this; perhaps a property on the database handle, or perhaps a special execute method that uses cursors, I don't know. But however it is implemented, it seems that there should be a simple way to make cursors available, even if they aren't used by default. Charles -- Covers a multitude of chins Burma-Shave http://burma-shave.org/jingles/1939/covers_a_multitude
signature.asc
Description: Digital signature