Bug report #8576
PostGIS literal special character not escaped
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17319|
When commiting a change to a PostGIS data source, for a text field, the "\\" special character is not escaped when transmitted to PostGIS. It is therefore interpreted as a special character and leads to wrong data or SQL error.
The case is particularly problematic with path stored in text fields.Typical use case on a windows platform :
- Setup a PostGIS table with a text or varchar field
- Open this table as a QGIS Layer
- Declare the text field as a filename path in QGIS Field types (so you can browse for file)
- Try to add/modify a feature, set a file path by browsing in subdirectories
- Commit, and see PostgreSQL error on escape character
Every "\\" character should be doubled as "\\\\" when passed to PostGIS.