Revision 10149
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/util.sql | ||
---|---|---|
1213 | 1213 |
old = old[1:array_length(new, 1)]; -- truncate to same length |
1214 | 1214 |
PERFORM util.try_create($$ALTER TABLE $$||$1||$$ RENAME $$ |
1215 | 1215 |
||quote_ident(key)||$$ TO $$||quote_ident(value)) |
1216 |
FROM each(hstore(old, new)); |
|
1216 |
FROM each(hstore(old, new)) |
|
1217 |
WHERE value != key -- not same name |
|
1218 |
; |
|
1217 | 1219 |
END; |
1218 | 1220 |
$_$; |
1219 | 1221 |
|
Also available in: Unified diff
schemas/util.sql: set_col_names(): don't perform rename if the name is not changing, to avoid cluttering the debug output with unnecessary queries