Revision 10128
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
729 | 729 |
|
730 | 730 |
|
731 | 731 |
-- |
732 |
-- Name: eval(text, anyelement); Type: FUNCTION; Schema: util; Owner: - |
|
733 |
-- |
|
734 |
|
|
735 |
CREATE FUNCTION eval(sql text, ret_type_null anyelement) RETURNS anyelement |
|
736 |
LANGUAGE plpgsql |
|
737 |
AS $$ |
|
738 |
DECLARE |
|
739 |
ret_val ret_type_null%TYPE; |
|
740 |
BEGIN |
|
741 |
RAISE NOTICE '%', sql; |
|
742 |
EXECUTE sql INTO STRICT ret_val; |
|
743 |
RETURN ret_val; |
|
744 |
END; |
|
745 |
$$; |
|
746 |
|
|
747 |
|
|
748 |
-- |
|
749 |
-- Name: FUNCTION eval(sql text, ret_type_null anyelement); Type: COMMENT; Schema: util; Owner: - |
|
750 |
-- |
|
751 |
|
|
752 |
COMMENT ON FUNCTION eval(sql text, ret_type_null anyelement) IS 'ret_type_null: NULL::ret_type'; |
|
753 |
|
|
754 |
|
|
755 |
-- |
|
732 | 756 |
-- Name: existing_cols(regclass, text[]); Type: FUNCTION; Schema: util; Owner: - |
733 | 757 |
-- |
734 | 758 |
|
Also available in: Unified diff
schemas/util.sql: added value-returning eval()