Project

General

Profile

« Previous | Next » 

Revision 12413

schemas/util.sql: added drop_relations_like()

View differences:

trunk/schemas/util.sql
1122 1122

  
1123 1123

  
1124 1124
--
1125
-- Name: drop_relations_like(text, anyelement, boolean); Type: FUNCTION; Schema: util; Owner: -
1126
--
1127

  
1128
CREATE FUNCTION drop_relations_like(name_regexp text, schema_anchor anyelement, force boolean DEFAULT false) RETURNS void
1129
    LANGUAGE sql
1130
    AS $_$
1131
SELECT util.drop_relations_like($1, util.str_equality_regexp(util.schema($2)),
1132
$3)
1133
$_$;
1134

  
1135

  
1136
--
1137
-- Name: drop_relations_like(text, text, boolean); Type: FUNCTION; Schema: util; Owner: -
1138
--
1139

  
1140
CREATE FUNCTION drop_relations_like(name_regexp text, schema_regexp text DEFAULT ''::text, force boolean DEFAULT false) RETURNS void
1141
    LANGUAGE sql
1142
    AS $_$
1143
SELECT util.drop_relation(relation, $3)
1144
FROM util.show_relations_like($1, $2) relation
1145
;
1146
SELECT NULL::void; -- don't fold away functions called in previous query
1147
$_$;
1148

  
1149

  
1150
--
1125 1151
-- Name: drop_table(text, boolean); Type: FUNCTION; Schema: util; Owner: -
1126 1152
--
1127 1153

  

Also available in: Unified diff