mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-23 21:04:39 -05:00
fix(jdbc-postgres): escape special chars on full text search
close kestra-io/kestra-ee#2430 close kestra-io/kestra-ee#2454
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
CREATE OR REPLACE FUNCTION FULLTEXT_REPLACE(text, text) RETURNS text
|
||||
LANGUAGE SQL
|
||||
IMMUTABLE
|
||||
RETURNS NULL ON NULL INPUT
|
||||
RETURN TRIM(BOTH $2 FROM ARRAY_TO_STRING(
|
||||
ARRAY(
|
||||
SELECT DISTINCT *
|
||||
FROM UNNEST(REGEXP_SPLIT_TO_ARRAY(COALESCE($1, ''), '[^a-zA-Z\d]')) AS a
|
||||
WHERE a != ''
|
||||
),
|
||||
$2
|
||||
));
|
||||
Reference in New Issue
Block a user