Re: postgresql DB::quoteSmart

From: Date: Mon, 29 Mar 2004 09:15:02 +0000
Subject: Re: postgresql DB::quoteSmart
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26842@lists.php.net to get a copy of this message
add this to the top of the pgsql.php file: if (!function_exists('pg_escape_string')) { function pg_escape_string($v) { return preg_replace (.........
        }
} it adds a slight performance hit for older postgress boxes.. - but should be ok. BTW - I thought that the postgres backend only worked with newer versions of postgress anyway, as it uses the 'new' limit format... Regards Alan Lukas Smith wrote:
Thomas Jarosch wrote:
Is there a reason it shouldn't use pg_escape_string() for that?
Docblock to escapeSimple() in the source code of pgsql.php says:
Sorry for being blind ;-)
    * Not using pg_escape_string() yet because it requires PostgreSQL
    * to be at version 7.2 or greater.
Well, version 7.2 was released in Feb 2002, that's over two years from now. What about adding function_exists('pg_escape_string')?
Seems like the better alternative is to introduce a new pgsql 7.2. driver that extends the current one. However going this route will increase the maintainance effort as well, but its probably the only solution to properly address this without slowing down things with many if's (as I can see this beng used in other places/drivers as well). regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

« previous php.pear.dev (#26842) next »