summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-08-08 20:28:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-08-08 20:28:27 +0100
commit8a6b929cba064e1752dcd36c59346f9e087ac361 (patch)
tree3c8e8289c83412d011c3b08eb387a374fc6bc1a8
parentFix format string for file size (diff)
downloadgentoobrowse-api-8a6b929cba064e1752dcd36c59346f9e087ac361.tar.bz2
gentoobrowse-api-8a6b929cba064e1752dcd36c59346f9e087ac361.tar.xz
gentoobrowse-api-8a6b929cba064e1752dcd36c59346f9e087ac361.zip
Update string literals in regex to behave predictably regardless of standard_conforming_strings
-rw-r--r--gentoobrowse-api/db/schema.sql4
1 files changed, 2 insertions, 2 deletions
diff --git a/gentoobrowse-api/db/schema.sql b/gentoobrowse-api/db/schema.sql
index f9bf489..d4bbce6 100644
--- a/gentoobrowse-api/db/schema.sql
+++ b/gentoobrowse-api/db/schema.sql
@@ -69,7 +69,7 @@ CREATE FUNCTION bugpackages(b bugs) RETURNS text[]
LANGUAGE plpgsql IMMUTABLE
AS $$
BEGIN
- RETURN ARRAY_AGG(p[1]) FROM REGEXP_MATCHES(b.summary, '([[:alnum:]-]+/[[:alnum:]_-]+?)(?:-(?:[0-9][.0-9]*[[:alpha:]]?\*?(?:(?:_(?:alpha|beta|pre|rc|p))?[[:digit:]]*)*(?:-r[[:digit:]]+)?))?', 'g') p;
+ RETURN ARRAY_AGG(p[1]) FROM REGEXP_MATCHES(b.summary, E'([[:alnum:]-]+/[[:alnum:]_-]+?)(?:-(?:[0-9][.0-9]*[[:alpha:]]?\\*?(?:(?:_(?:alpha|beta|pre|rc|p))?[[:digit:]]*)*(?:-r[[:digit:]]+)?))?', 'g') p;
END
$$;
ALTER FUNCTION gentoobrowse.bugpackages(b bugs) OWNER TO gentoo;
@@ -97,7 +97,7 @@ CREATE FUNCTION textclean(t text) RETURNS text
LANGUAGE plpgsql IMMUTABLE
AS $$
BEGIN
- RETURN TRIM(REGEXP_REPLACE(t, '\s+', ' ', 'g'));
+ RETURN TRIM(REGEXP_REPLACE(t, E'\\s+', ' ', 'g'));
END
$$;
ALTER FUNCTION gentoobrowse.textclean(t text) OWNER TO gentoo;