|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-12 22:54 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
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));