Revision 8095
Added by Aaron Marcuse-Kubitza almost 12 years ago
schemas/functions.sql | ||
---|---|---|
506 | 506 |
|
507 | 507 |
|
508 | 508 |
-- |
509 |
-- Name: contains(text, text); Type: FUNCTION; Schema: functions; Owner: - |
|
510 |
-- |
|
511 |
|
|
512 |
CREATE FUNCTION contains(search_for text, in_str text) RETURNS boolean |
|
513 |
LANGUAGE sql IMMUTABLE STRICT |
|
514 |
AS $_$ |
|
515 |
SELECT position($1 in $2) > 0 /*1-based offset*/ |
|
516 |
$_$; |
|
517 |
|
|
518 |
|
|
519 |
-- |
|
509 | 520 |
-- Name: create_if_not_exists(text); Type: FUNCTION; Schema: functions; Owner: - |
510 | 521 |
-- |
511 | 522 |
|
Also available in: Unified diff
schemas/functions.sql: Added contains()