Skip to content
Permalink
Browse files

postgres provider: improve value quoting

  • Loading branch information
jef-n committed Mar 6, 2014
1 parent d991ebf commit 7829e7aa856a7d3701f510af60508f88d40fda64
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/providers/postgres/qgspostgresconn.cpp
@@ -772,8 +772,10 @@ QString QgsPostgresConn::quotedValue( QVariant value )
case QVariant::String:
QString v = value.toString();
v.replace( "'", "''" );
v.replace( "\\\"", "\\\\\"" );
return v.prepend( "'" ).append( "'" );
if( v.contains( "\\" ) )
return v.replace( "\\", "\\\\" ).prepend("E'").append("'");
else
return v.prepend( "'" ).append( "'" );
}
}

0 comments on commit 7829e7a

Please sign in to comment.
You can’t perform that action at this time.