* DRYD-1748: added SQL script to define deurn function
* DRYD-1748: modified tenant bindings to run deurn_function.sql
---------
Co-authored-by: Anthony Bucci <abucci@bucci.onl>
<service:key>sqlScriptName</service:key>
<service:value>unaccent_text_search_configuration.sql</service:value>
</service:property>
+ <service:property>
+ <service:key>sqlScriptName</service:key>
+ <service:value>deurn_function.sql</service:value>
+ </service:property>
</service:params>
</service:initHandler>
</tenant:serviceBindings>
--- /dev/null
+-- Convert a URN (often refname) (DRYD-1748: Add deurn function to database)
+CREATE OR REPLACE FUNCTION deurn(urnstr VARCHAR) RETURNS VARCHAR
+AS $BODY$ BEGIN RETURN ((regexp_match(urnstr, '''([^''\\]*(\\.[^''\\]*)*)'''))[1]); END $BODY$ LANGUAGE plpgsql IMMUTABLE;