Revision 12357
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
3071 | 3071 |
|
3072 | 3072 |
|
3073 | 3073 |
-- |
3074 |
-- Name: truncated_prefixed_name_regexp(text, integer); Type: FUNCTION; Schema: util; Owner: - |
|
3075 |
-- |
|
3076 |
|
|
3077 |
CREATE FUNCTION truncated_prefixed_name_regexp(name text, max_prefix_len integer) RETURNS text |
|
3078 |
LANGUAGE sql IMMUTABLE |
|
3079 |
AS $_$ |
|
3080 |
SELECT '^(.*)'||util._if(util.name_was_truncated($1), |
|
3081 |
util.regexp_quote(util.rtrim_n($1, $2)), util.regexp_quote($1)||'$') |
|
3082 |
$_$; |
|
3083 |
|
|
3084 |
|
|
3085 |
-- |
|
3074 | 3086 |
-- Name: try_create(text); Type: FUNCTION; Schema: util; Owner: - |
3075 | 3087 |
-- |
3076 | 3088 |
|
Also available in: Unified diff
schemas/util.sql: added truncated_prefixed_name_regexp()