Project

General

Profile

« Previous | Next » 

Revision 12685

fix: schemas/util.sql: diff(regclass, regclass): moved try_create() of copies column in parent table to auto_rm_freq() so that it would only happen if both tables actually contain a copies column (otherwise, the try_create() will create an empty copies column if both tables are empty)

View differences:

util.sql
687 687
    AS $_$
688 688
SELECT CASE WHEN util.freq_always_1($1, $2)
689 689
THEN util.drop_column($1, $2, force := true)
690
ELSE util.try_create($$ALTER TABLE $$||util.parent($1[1])||$$ ADD COLUMN $$||quote_ident($2)||$$ bigint NOT NULL$$)
690 691
END
691 692
$_$;
692 693

  
......
1091 1092
SELECT util.to_freq($1);
1092 1093
SELECT util.to_freq($2);
1093 1094
SELECT util.auto_rm_freq(ARRAY[$1, $2]);
1094
SELECT util.try_create($$ALTER TABLE $$||util.typeof($3)||$$ ADD COLUMN copies bigint NOT NULL$$);
1095 1095

  
1096 1096
SELECT * FROM util.diff($1, $2, $3, has_freq := true)
1097 1097
$_$;

Also available in: Unified diff