|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51608 pg_copy_to: WARNING: nonstandard use of \\ in a string literal
Submitted: 2010-04-20 02:16 UTC Modified: 2010-04-20 13:51 UTC
From: cbandy at jbandy dot com Assigned: felipe (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cbandy at jbandy dot com
New email:
PHP Version: OS:


 [2010-04-20 02:16 UTC] cbandy at jbandy dot com
Whenever I use pg_copy_to() on PostgreSQL 8.4.2 I get a warning in /var/lib/pgsql/data/postmaster.log:

> WARNING:  nonstandard use of \\ in a string literal at character 62
> HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.

This is caused by the SQL generated in pg_copy_to.

r277069 addressed this issue for pg_copy_from and should also be applied to pg_copy_to.

Test script:
// setup
pg_query($db, 'CREATE TEMP TABLE temp_test_table (a INT)');
pg_query($db, 'INSERT INTO temp_test_table VALUES (1)');

// test
$rows = pg_copy_to($db, 'temp_test_table');


pgsql_copy_to_escape.patch (last revision 2010-04-20 00:16 UTC by cbandy at jbandy dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-20 13:49 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #51608 (pg_copy_to: WARNING: nonstandard use of \\ in a string literal)
Patch by: cbandy at jbandy dot com
 [2010-04-20 13:51 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-20 13:51 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Thanks for the patch.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 01:01:23 2020 UTC