Re: PEAR: Database Abstraction Layer porting to PostgreSQL 7.3
| From: | Wolfram Kriesing | Date: | Tue, 11 Mar 2003 10:21:30 +0000 |
| Subject: | Re: PEAR: Database Abstraction Layer porting to PostgreSQL 7.3 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14193@lists.php.net to get a copy of this message | ||
iirc postgreSQL 7.3 does also not support the LIMIT-clause anymore, you have to use LIMIT x OFFSET y
this need to be fixed too (i think)
Alex wrote:
Dear Developers,
there have appeared some problems with PEAR::DB once PostGreSQL has been
upgraded to version 7.3. The new version of PostgreSQL does not allow
weak types and this is not a configurable option.
For example, inserting empty strings OR joining tables based on empty
strings OR projecting tables using empty strings does not work anymore
in case the column worked with is of a type other than varchar or text.
I have noticed that quite a bit of code based around PostGreSQL earlier
than 7.3 made use of this paradigm, and the very same code refuses to
work on the new engine.
This problem can easily be solved by patching PEAR::DB::common forcing
it to replace empty strings '' with NULL.
Here is the neccessary code fragment:
<code>
function &query($query, $params = array()) {
$query = str_replace("''","NULL",$query);
...
</code>
this es easily made into a configurable option upon initialization of DB
and will definately be of some help to many projects based on older
codebases.
best regards,
A. Kulikov
--
Wolfram
... opensource @ vision:produktion ...
http://opensource.visionp.de
... translating template engine ....
http://sf.net/projects/simpletpl
... authentication system ....
http://sf.net/projects/auth