Project

General

Profile

« Previous | Next » 

Revision 10297

schemas/util.sql: added reset_col_names(), the counterpart to set_col_names(). note that this alters the map table, so it will need to be repopulated after running this function.

View differences:

schemas/util.sql
1199 1199

  
1200 1200

  
1201 1201
--
1202
-- Name: reset_col_names(regclass, regclass); Type: FUNCTION; Schema: util; Owner: -
1203
--
1204

  
1205
CREATE FUNCTION reset_col_names(table_ regclass, names regclass) RETURNS void
1206
    LANGUAGE sql STRICT
1207
    AS $_$
1208
SELECT util.mk_derived_col(($2, 'to'), $$"from"$$, overwrite := true);
1209
SELECT util.set_col_names($1, $2);
1210
$_$;
1211

  
1212

  
1213
--
1214
-- Name: FUNCTION reset_col_names(table_ regclass, names regclass); Type: COMMENT; Schema: util; Owner: -
1215
--
1216

  
1217
COMMENT ON FUNCTION reset_col_names(table_ regclass, names regclass) IS 'idempotent.
1218
alters the names table, so it will need to be repopulated after running this function.';
1219

  
1220

  
1221
--
1202 1222
-- Name: reset_map_table(text); Type: FUNCTION; Schema: util; Owner: -
1203 1223
--
1204 1224

  

Also available in: Unified diff