Revision 12350
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2409 | 2409 |
|
2410 | 2410 |
|
2411 | 2411 |
-- |
2412 |
-- Name: replace_suffix(text, text, text); Type: FUNCTION; Schema: util; Owner: - |
|
2413 |
-- |
|
2414 |
|
|
2415 |
CREATE FUNCTION replace_suffix(str text, old_suffix text, new_suffix text) RETURNS text |
|
2416 |
LANGUAGE sql IMMUTABLE |
|
2417 |
AS $_$ |
|
2418 |
SELECT regexp_replace($1, '^(.*)'||util.regexp_quote($2)||'$', '\1'||$3) |
|
2419 |
$_$; |
|
2420 |
|
|
2421 |
|
|
2422 |
-- |
|
2412 | 2423 |
-- Name: reset_col_names(regclass, regclass); Type: FUNCTION; Schema: util; Owner: - |
2413 | 2424 |
-- |
2414 | 2425 |
|
Also available in: Unified diff
schemas/util.sql: added replace_suffix()