]> granicus.if.org Git - php/commit
Take a blind stab at implementing scrollable cursors for pgsql.
authorWez Furlong <wez@php.net>
Thu, 13 Jan 2005 01:59:39 +0000 (01:59 +0000)
committerWez Furlong <wez@php.net>
Thu, 13 Jan 2005 01:59:39 +0000 (01:59 +0000)
commitef0de01b62abcaaa72d85c64d27adcbc5945e157
tree38fecacaf0b1cc52908d3074f2973c9d8a8da11f
parent10cba41a70f546316056d2ef27a5509a82c236f9
Take a blind stab at implementing scrollable cursors for pgsql.
We allocate a unique cursor name for each statement, so that we
don't interfere with other open statement handles on the same dbh.

Note, however, that we force a new transaction for each open scrollable cursor
(postgres requires cursors to be used inside a transaction).  This is okay,
except for the case where a scrollable cursor is opened, an update is made and
the cursor is closed; closing the cursor commits the transaction that was begun
when it was opened.

It might well be better to avoid the transaction in PDO and force the user to
be aware of the requirements of cursors and explicitly initiate the transaction
themselves.

This is all untested code; it compiles and looks like it will work, but I
encourage someone with a real postgres setup to actually sit down and try to
use it.
ext/pdo_pgsql/pgsql_driver.c
ext/pdo_pgsql/pgsql_statement.c
ext/pdo_pgsql/php_pdo_pgsql_int.h