Project

General

Profile

« Previous | Next » 

Revision 8185

schemas/util.sql: Added typeof(text, regtype)

View differences:

schemas/util.sql
934 934

  
935 935

  
936 936
--
937
-- Name: typeof(text, regtype); Type: FUNCTION; Schema: util; Owner: -
938
--
939

  
940
CREATE FUNCTION typeof(expr text, table_ regtype) RETURNS regtype
941
    LANGUAGE plpgsql STABLE STRICT
942
    AS $_$
943
DECLARE
944
    type regtype;
945
BEGIN
946
    EXECUTE $$SELECT pg_typeof($$||expr||$$) FROM (SELECT (NULL::$$||table_||
947
    $$).*) _s$$ INTO STRICT type;
948
    RETURN type;
949
END;
950
$_$;
951

  
952

  
953
--
937 954
-- Name: join_strs(text, text); Type: AGGREGATE; Schema: util; Owner: -
938 955
--
939 956

  

Also available in: Unified diff