From: thuejk at gmail dot com
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: PostgreSQL related
Bug description: pg_copy_from: WARNING: nonstandard use of \\ in a string
literal
Description:
------------
Whenever I use pg_copy_from() I get an error in
/var/log/postgresql/postgresql-8.3-main.log :
2009-03-12 19:43:12 CET WARNING: nonstandard use of \\ in a string
literal at character 82
2009-03-12 19:43:12 CET HINT: Use the escape string syntax for
backslashes, e.g., E'\\'.
This is caused by pg_copy_from(), which in pgsql.c does something like the
following:
spprintf(&query, 0, "COPY \"%s\" FROM STDIN DELIMITERS '%c' WITH NULL
AS '%s'", table_name, *pg_delim, "\\\\N");
If I pass the optional custom NULL indicator arg to pg_copy_from, ie
replace "\\\\N" with for example "NULL", then the error goes away.
Reproduce code:
---------------
pg_query($db->connection, "CREATE TABLE test(a INT)");
pg_copy_from($db->connection, "test", Array(1));
--
Edit bug report at http://bugs.php.net/?id=47639&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47639&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47639&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47639&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47639&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47639&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47639&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47639&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47639&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47639&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47639&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47639&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47639&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47639&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47639&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47639&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47639&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47639&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47639&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47639&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47639&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47639&r=mysqlcfg