Project

General

Profile

« Previous | Next » 

Revision 13468

schemas/util.sql: show_create_view(): made inclusion of `OR REPLACE` configurable

View differences:

util.sql
3701 3701

  
3702 3702

  
3703 3703
--
3704
-- Name: show_create_view(regclass); Type: FUNCTION; Schema: util; Owner: -
3704
-- Name: show_create_view(regclass, boolean); Type: FUNCTION; Schema: util; Owner: -
3705 3705
--
3706 3706

  
3707
CREATE FUNCTION show_create_view(view_ regclass) RETURNS text
3707
CREATE FUNCTION show_create_view(view_ regclass, replace boolean DEFAULT true) RETURNS text
3708 3708
    LANGUAGE sql STABLE
3709 3709
    AS $_$
3710
SELECT $$CREATE OR REPLACE VIEW $$||$1||$$ AS $$||pg_get_viewdef($1)||$$;
3710
SELECT $$CREATE$$||(CASE WHEN $2 THEN $$ OR REPLACE$$ ELSE '' END)||$$ VIEW $$
3711
||$1||$$ AS
3712
$$||pg_get_viewdef($1)||$$;
3711 3713
$$||util.show_grants_for($1)
3712 3714
$_$;
3713 3715

  

Also available in: Unified diff