Bug #3645

String literal escape database warning in postgresql

Added by Sofia Papagiannaki over 8 years ago. Updated about 8 years ago.

Status:Resolved Start date:04/22/2013
Priority:Medium Due date:
Assignee:Sofia Papagiannaki % Done:

0%

Category:Pithos Spent time: -
Target version:-

Description

Pithos requires to escape SQL wildcards in order to permit such characters in object paths.
Therefore, uses backslashes to escape like patterns
Issue #1768

However, Postgresql 8.4, contrary to the SQL standard, treats dy default baskslashes as escape characters
(this has been changed since postgresql 9.1 - standard_conforming_strings has become on dy default)
http://stackoverflow.com/questions/2106207/escape-sql-like-value-for-postgres-with-psycopg2#answer-2106443

As a result, it produces the following output:
WARNING: nonstandard use of \\ in a string literal at character 101
HINT: Use the escape string syntax for backslashes, e.g., E'\\'.

for SQL statements (constructed by sqlalchemy) such as:

SELECT nodes.node 
    FROM nodes 
    WHERE nodes.path LIKE E'c18088be-16b1-4263-8180-043c54e22903' ESCAPE '\\'
The proposed solutions are:

or

Associated revisions

Revision 235a4227
Added by Sofia Papagiannaki over 8 years ago

pithos: use other db escape string literal character

Refs: #3645

History

#1 Updated by Sofia Papagiannaki about 8 years ago

  • Status changed from Assigned to Resolved

Also available in: Atom PDF