Re: Modifications for Postgres driver

From: Date: Tue, 19 Jun 2001 04:46:33 +0000
Subject: Re: Modifications for Postgres driver
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-57161@lists.php.net to get a copy of this message
This has bugged me as well in the past. Once the cvs server comes back alive, we'll get you set up with a cvs account and you can apply these patches. Stay tuned for a message from Sascha saying it is back. -Rasmus On Tue, 19 Jun 2001, Georg von Zezschwitz wrote: > 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 (#57161) next »