Revision 10596
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1481 | 1481 |
CREATE FUNCTION reset_col_names(table_ regclass, names regclass) RETURNS void |
1482 | 1482 |
LANGUAGE sql STRICT |
1483 | 1483 |
AS $_$ |
1484 |
SELECT util.mk_derived_col(($2, 'to'),
|
|
1485 |
$$CASE WHEN "from" LIKE ':%' THEN "to" ELSE "from" END$$, overwrite := true);
|
|
1484 |
SELECT util.eval($$DELETE FROM $$||$2||$$ WHERE "from" LIKE ':%'$$);
|
|
1485 |
SELECT util.mk_derived_col(($2, 'to'), $$"from"$$, overwrite := true);
|
|
1486 | 1486 |
SELECT util.set_col_names($1, $2); |
1487 | 1487 |
$_$; |
1488 | 1488 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: reset_col_names(): remove metadata value columns from the map table entirely, so that they are not considered to be in the table (old-style import does not use metadata value columns, so there would be no column or a different column in the metadata value column's slot)