From: Jason Stephenson <jason@sigio.com>
Date: Tue, 6 Nov 2018 16:00:33 +0000 (-0500)
Subject: Lp 1730726: Fix lp1501781-unaccent_and_squash.pg for PostgreSQL 10
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b10d97df412eac54423dd29d585df053bce29b57;p=evergreen%2Fequinox.git

Lp 1730726: Fix lp1501781-unaccent_and_squash.pg for PostgreSQL 10

PostgreSQL 10 has improvements in the unaccent function used by the
evergreen.unaccent_and_squash function.  The test needs a small
modification to take this into account.  Actual code change from Mike
Rylander with a little typo fix.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Ben Shum <ben@evergreener.net>
---

diff --git a/Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg b/Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg
index c90014fd3d..3238804344 100644
--- a/Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg
+++ b/Open-ILS/src/sql/Pg/t/lp1501781-unaccent_and_squash.pg
@@ -54,7 +54,7 @@ SELECT is(evergreen.unaccent_and_squash('El Niño'),
           'elnino', 'Spanish "The Kid"');
 
 SELECT is(evergreen.unaccent_and_squash('Œuvres'),
-          'euvres', 'oe ligature');
+          CASE WHEN regexp_replace(regexp_replace(version(),'\..+',''),'^PostgreSQL ','')::INT >= 10 THEN 'oeuvres' ELSE 'euvres' END, 'oe ligature');
 
 -- Punctuation Tests