Bug report #9158
lpad() and rpad() functions do not work in standard way
|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|
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.