php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cbandy at jbandy dot com
New email:
PHP Version: OS:

 

 [2010-04-20 02:16 UTC] cbandy at jbandy dot com
Description:
------------
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');



Patches

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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-20 13:49 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=298210
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] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-20 13:51 UTC] felipe@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC