Revision 8086
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/functions.sql | ||
---|---|---|
505 | 505 |
|
506 | 506 |
|
507 | 507 |
-- |
508 |
-- Name: ensure_prefix(text, text); Type: FUNCTION; Schema: functions; Owner: - |
|
509 |
-- |
|
510 |
|
|
511 |
CREATE FUNCTION ensure_prefix(prefix text, str text) RETURNS text |
|
512 |
LANGUAGE sql STABLE |
|
513 |
AS $_$ |
|
514 |
SELECT (CASE WHEN functions.has_prefix($1, $2) THEN $2 ELSE $1||$2 END) |
|
515 |
$_$; |
|
516 |
|
|
517 |
|
|
518 |
-- |
|
508 | 519 |
-- Name: has_prefix(text, text); Type: FUNCTION; Schema: functions; Owner: - |
509 | 520 |
-- |
510 | 521 |
|
Also available in: Unified diff
schemas/functions.sql: Added ensure_prefix()