Revision 14781
Added by Aaron Marcuse-Kubitza about 10 years ago
util.sql | ||
---|---|---|
5588 | 5588 |
new text[] = ARRAY(SELECT util.map_values(names)); |
5589 | 5589 |
BEGIN |
5590 | 5590 |
old = old[1:array_length(new, 1)]; -- truncate to same length |
5591 |
PERFORM util.eval($$ALTER TABLE $$||$1||$$ RENAME $$||quote_ident(key) |
|
5592 |
||$$ TO $$||quote_ident(value)) |
|
5591 |
PERFORM util.col_rename(($1, key), value) |
|
5593 | 5592 |
FROM each(hstore(old, new)) |
5594 | 5593 |
WHERE value != key -- not same name |
5595 | 5594 |
; |
Also available in: Unified diff
schemas/util.sql: set_col_names(): use util.col_rename() so that all renames uses this function