Project

General

Profile

« Previous | Next » 

Revision 14287

schemas/util.sql: added view_body()

View differences:

util.sql
5938 5938

  
5939 5939

  
5940 5940
--
5941
-- Name: view_body(text); Type: FUNCTION; Schema: util; Owner: -
5942
--
5943

  
5944
CREATE FUNCTION view_body(view_def text) RETURNS text
5945
    LANGUAGE sql IMMUTABLE
5946
    AS $_$
5947
SELECT (SELECT regexp_matches(view_def, '(?w).*?^CREATE .*?;
5948
'))[1] -- (?w) : ^$ multiline but . dotall
5949
$_$;
5950

  
5951

  
5952
--
5941 5953
-- Name: view_def_to_orig(text); Type: FUNCTION; Schema: util; Owner: -
5942 5954
--
5943 5955

  

Also available in: Unified diff