Project

General

Profile

« Previous | Next » 

Revision 12360

schemas/util.sql: name_was_truncated(): support max_prefix_len param to determine truncation of something that will be prefixed

View differences:

trunk/schemas/util.sql
2072 2072

  
2073 2073

  
2074 2074
--
2075
-- Name: name_was_truncated(text); Type: FUNCTION; Schema: util; Owner: -
2075
-- Name: name_was_truncated(text, integer); Type: FUNCTION; Schema: util; Owner: -
2076 2076
--
2077 2077

  
2078
CREATE FUNCTION name_was_truncated(name_ text) RETURNS boolean
2078
CREATE FUNCTION name_was_truncated(name_ text, max_prefix_len integer DEFAULT 0) RETURNS boolean
2079 2079
    LANGUAGE sql IMMUTABLE
2080 2080
    AS $_$
2081
SELECT octet_length($1) = util.namedatalen()
2081
SELECT octet_length($1) >= util.namedatalen() - $2
2082 2082
$_$;
2083 2083

  
2084 2084

  

Also available in: Unified diff