Bug report #9158

lpad() and rpad() functions do not work in standard way

Added by Lee Hachadoorian over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:2.0.1 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:17791

Description

In PostGIS and Oracle, lpad('A', 5, 'x') produces 'xxxxA'. In the expression editor in QGIS, it produces 'Axxxx'. Similarly, rpad() adds extra characters to the left, while PostGIS and Oracle add extra characters to the right.

I think the PostGIS way is the commonly understood behavior, since lpad is supposed to mean "left pad" and rpad is supposed to mean "right pad". QGIS should adopt the conventional behavior.


Related issues

Related to QGIS Application - Bug report #9388: rpad doesn't work Closed 2014-01-20

Associated revisions

Revision bc825b4b
Added by Jürgen Fischer over 10 years ago

fix lpad/rpad (fixes #9158)

History

#2 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Open to Closed

#3 Updated by Jürgen Fischer over 10 years ago

  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to 2.0.1
  • Tracker changed from Feature request to Bug report

Also available in: Atom PDF