LP1464765: Improve Number Padding for Sort Keys collab/jboyer/lp1464765_lpad_number
authorJason Boyer <jboyer@library.in.gov>
Tue, 30 Jun 2015 12:53:21 +0000 (08:53 -0400)
committerJason Boyer <jboyer@library.in.gov>
Tue, 30 Jun 2015 13:09:55 +0000 (09:09 -0400)
commit3ab97af76335074da026e9dc42d1277a3d875151
tree29bb44c5ae0db0e034f126349cfd4c4b49bbd256
parent40605b36c190714723322862eb89fe39c24228ca
LP1464765: Improve Number Padding for Sort Keys

Past versions of evergreen.lpad_number_substrings would behave
poorly when there were multiple matching substrings within the
label, such as '2015 01', where the expansion of 01 would also
cause a replacement of the 01 in 2015. That lead to things like
02000015 00001 instead of 02015 00001.

Thanks to Thomas Berezansky for a much simplified approach.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Open-ILS/src/sql/Pg/002.functions.config.sql
Open-ILS/src/sql/Pg/t/lpad_number_substrings.pg
Open-ILS/src/sql/Pg/upgrade/XXXX.function.lpad_number_fix.sql [new file with mode: 0644]