Revision 10593
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sql | ||
---|---|---|
1456 | 1456 |
CREATE FUNCTION reset_col_names(table_ regclass, names regclass) RETURNS void |
1457 | 1457 |
LANGUAGE sql STRICT |
1458 | 1458 |
AS $_$ |
1459 |
SELECT util.mk_derived_col(($2, 'to'), $$"from"$$, overwrite := true); |
|
1459 |
SELECT util.mk_derived_col(($2, 'to'), |
|
1460 |
$$CASE WHEN "from" LIKE ':%' THEN "to" ELSE "from" END$$, overwrite := true); |
|
1460 | 1461 |
SELECT util.set_col_names($1, $2); |
1461 | 1462 |
$_$; |
1462 | 1463 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: reset_col_names(): need to avoid renaming metadata value columns, because the "from" entry is a value, not a column name