Project

General

Profile

« Previous | Next » 

Revision 10133

schemas/util.sql: added eval_expr_passthru() (passes NULL SQL through)

View differences:

schemas/util.sql
794 794

  
795 795

  
796 796
--
797
-- Name: eval_expr_passthru(text, anyelement); Type: FUNCTION; Schema: util; Owner: -
798
--
799

  
800
CREATE FUNCTION eval_expr_passthru(sql text, ret_type_null anyelement DEFAULT NULL::text) RETURNS anyelement
801
    LANGUAGE sql
802
    AS $_$
803
SELECT CASE WHEN $1 IS NULL THEN NULL ELSE util.eval_expr($1, $2) END
804
$_$;
805

  
806

  
807
--
808
-- Name: FUNCTION eval_expr_passthru(sql text, ret_type_null anyelement); Type: COMMENT; Schema: util; Owner: -
809
--
810

  
811
COMMENT ON FUNCTION eval_expr_passthru(sql text, ret_type_null anyelement) IS 'sql: can be NULL, which will be passed through
812
ret_type_null: NULL::ret_type';
813

  
814

  
815
--
797 816
-- Name: existing_cols(regclass, text[]); Type: FUNCTION; Schema: util; Owner: -
798 817
--
799 818

  

Also available in: Unified diff