On Fri, May 20, 2011 at 03:24, Yasuo Ohgaki <yohg...@ohgaki.net> wrote: > Hi all > > Current PostgreSQL has new escape functions for literals and identifiers. > Since there is no function for that, I made patch for that. Attached patch is > for trunk and tested with PostgreSQL 8.4 and 9.0. > > This patch would also applied to 5.4 branch but how about 5.3? > It's pain not to have escape functions. > > Any comments?
This won't compile if HAVE_PQESCAPE isn't declared since you only register the arginfo when it is, but use it even if it wasn't. There is also very inconsistent usage of space vs tab in the patch. + if (!tmp) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); + RETURN_FALSE; + } Won't this also trigger the error if there was no from passed? I suppose checking from_len wouldn't be stupid. Should we really provide fallback if PQescape(Literal|Identifier) isn't available? Did you copy the escaping from postgresql directly? -Hannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php