Project

General

Profile

« Previous | Next » 

Revision 12132

schemas/util.sql: added schema_rm(), schema_rename()

View differences:

trunk/schemas/util.sql
1898 1898

  
1899 1899

  
1900 1900
--
1901
-- Name: schema_rename(text, text); Type: FUNCTION; Schema: util; Owner: -
1902
--
1903

  
1904
CREATE FUNCTION schema_rename(old text, new text) RETURNS void
1905
    LANGUAGE sql
1906
    AS $_$
1907
SELECT util.eval($$ALTER SCHEMA $$||quote_ident($1)||$$ RENAME TO $$||quote_ident($2));
1908
$_$;
1909

  
1910

  
1911
--
1912
-- Name: schema_rm(text); Type: FUNCTION; Schema: util; Owner: -
1913
--
1914

  
1915
CREATE FUNCTION schema_rm(schema text) RETURNS void
1916
    LANGUAGE sql
1917
    AS $_$
1918
SELECT util.eval($$DROP SCHEMA IF EXISTS $$||quote_ident($1)||$$ CASCADE$$);
1919
$_$;
1920

  
1921

  
1922
--
1901 1923
-- Name: search_path_append(text); Type: FUNCTION; Schema: util; Owner: -
1902 1924
--
1903 1925

  

Also available in: Unified diff