Project

General

Profile

« Previous | Next » 

Revision 12264

schemas/vegbien.sql: added rematerialize_in_view()

View differences:

trunk/schemas/vegbien.my.sql
868 868

  
869 869

  
870 870
--
871
-- Name: rematerialize_in_view(regclass); Type: FUNCTION; Schema: public_validations; Owner: -
872
--
873

  
874

  
875

  
876

  
877
--
878
-- Name: FUNCTION rematerialize_in_view(in_view regclass); Type: COMMENT; Schema: public_validations; Owner: -
879
--
880

  
881

  
882

  
883

  
884
--
871 885
-- Name: rematerialize_out_view(varchar(255), regclass); Type: FUNCTION; Schema: public_validations; Owner: -
872 886
--
873 887

  
trunk/schemas/vegbien.sql
1930 1930
SET search_path = public_validations, pg_catalog;
1931 1931

  
1932 1932
--
1933
-- Name: rematerialize_in_view(regclass); Type: FUNCTION; Schema: public_validations; Owner: -
1934
--
1935

  
1936
CREATE FUNCTION rematerialize_in_view(in_view regclass) RETURNS regclass
1937
    LANGUAGE plpgsql
1938
    AS $$
1939
DECLARE
1940
	in_table text = util.qual_name(util.schema(in_view), '_in_'||util.name(in_view));
1941
BEGIN
1942
	PERFORM util.rematerialize_view(in_table, in_view);
1943
	
1944
	RETURN in_table;
1945
END;
1946
$$;
1947

  
1948

  
1949
--
1950
-- Name: FUNCTION rematerialize_in_view(in_view regclass); Type: COMMENT; Schema: public_validations; Owner: -
1951
--
1952

  
1953
COMMENT ON FUNCTION rematerialize_in_view(in_view regclass) IS '
1954
usage:
1955
SELECT public_validations.rematerialize_in_view(''datasource._view_name'') AS in_table;
1956

  
1957
idempotent, but repeats action each time
1958
';
1959

  
1960

  
1961
--
1933 1962
-- Name: rematerialize_out_view(text, regclass); Type: FUNCTION; Schema: public_validations; Owner: -
1934 1963
--
1935 1964

  

Also available in: Unified diff