Fix data corruption bug reported by robjderr (#1010664).
pg_reorg broke catalog definition if the target table had any dropped columns. Now pg_reorg removes dropped columns and renumbers valid columns. You can use pg_reorg to shrink column definitions if you have many dropped columns. (without pg_reorg, dropped columns are filled with zero forever)
This commit is contained in:
@ -83,7 +83,7 @@ $$
|
||||
') = (' || $2 || '.' ||
|
||||
array_to_string(reorg.array_accum(quote_ident(attname)), ', ' || $2 || '.') || ')'
|
||||
FROM (SELECT attname FROM pg_attribute
|
||||
WHERE attrelid = $1 AND attnum > 0
|
||||
WHERE attrelid = $1 AND attnum > 0 AND NOT attisdropped
|
||||
ORDER BY attnum) tmp;
|
||||
$$
|
||||
LANGUAGE sql STABLE STRICT;
|
||||
|
Reference in New Issue
Block a user