Revision 14146
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
2097 | 2097 |
|
2098 | 2098 |
|
2099 | 2099 |
-- |
2100 |
-- Name: extract_str(text, text, text); Type: FUNCTION; Schema: util; Owner: - |
|
2101 |
-- |
|
2102 |
|
|
2103 |
CREATE FUNCTION extract_str(prefix text, suffix text, str text) RETURNS text |
|
2104 |
LANGUAGE sql IMMUTABLE |
|
2105 |
AS $$ |
|
2106 |
SELECT util.remove_suffix(suffix, |
|
2107 |
util.remove_prefix(prefix, str, require := true), require := true) |
|
2108 |
$$; |
|
2109 |
|
|
2110 |
|
|
2111 |
-- |
|
2100 | 2112 |
-- Name: first_word(text); Type: FUNCTION; Schema: util; Owner: - |
2101 | 2113 |
-- |
2102 | 2114 |
|
Also available in: Unified diff
schemas/util.sql: added extract_str()