Modifications for Postgres driver

From: Date: Tue, 19 Jun 2001 00:04:59 +0000
Subject: Modifications for Postgres driver
Groups: php.dev 
Request: Send a blank email to php-dev+get-56831@lists.php.net to get a copy of this message
Hi, As I wanted to migrate a project from ODBC to Postgres, I found it easier to modify the postgres driver of PHP 4.0.x than to change my source. What I disliked (like the PEAR people) is the missing of a row counter when fetching rows from Postgres result tables. The mysql/ODBC/Adabas/some-other - way is: $dbr = xxx_exec ($connection, $query); while (list ($a, $b, $c) = xxx_fetch_row ($dbr)) { ... // Great, I have my results } The traditional and only Postgres way is: $dbr = xxx_exec ($connection, $query); $cnt = pg_num_rows ($dbr); for ($i = 0; $i < $cnt; $i++) { list ($a, $b, $c) = pg_fetch_row ($dbr, $i) } The Postgres way is ugly, but it also makes it difficult e.g. for the PEAR people to implement the unified interface. I found it as easy as expected to write a patch that makes Postgres driver behave like the other drivers, of cause with full backward compatibility by making the row number parameter optional. I also changed the pg_result and the other row-aware functions. Now, is there a chance to get this into the offical source? Whom should I contact? I'm willing to update the documentation in English and German if the patch should be used - but where to I get it? Could anybody name me a person with CVS access? Regards, Georg

« previous php.dev (#56831) next »