ID: 47639 Updated by: il...@php.net Reported By: thuejk at gmail dot com -Status: Open +Status: Closed Bug Type: PostgreSQL related Operating System: Linux PHP Version: 5.2.9 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-03-12 18:46:23] thuejk at gmail dot com 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 this bug report at http://bugs.php.net/?id=47639&edit=1