Project

General

Profile

« Previous | Next » 

Revision 5830

schemas/vegbien.sql: taxonlabel_2_set_canon_label_id_on_*(): Fixed bug where need to use := instead of = to perform assignment of canon_label_id

View differences:

vegbien.sql
521 521
    LANGUAGE plpgsql
522 522
    AS $$
523 523
BEGIN
524
    new.canon_label_id = new.taxonlabel_id; -- make self-reference
524
    new.canon_label_id := new.taxonlabel_id; -- make self-reference
525 525
    RETURN new;
526 526
END;
527 527
$$;
......
538 538
    IF new.matched_label_id IS DISTINCT FROM old.matched_label_id THEN
539 539
        IF new.matched_label_id IS NOT NULL THEN
540 540
            IF new.matched_label_id = new.taxonlabel_id THEN -- self-reference
541
                new.canon_label_id = new.taxonlabel_id; -- make self-reference
541
                new.canon_label_id := new.taxonlabel_id; -- make self-reference
542 542
            ELSE -- propagate from matched label
543
                new.canon_label_id = (
543
                new.canon_label_id := (
544 544
                    SELECT canon_label_id
545 545
                    FROM taxonlabel
546 546
                    WHERE taxonlabel_id = new.matched_label_id
......
554 554
            AND taxonlabel_id != new.taxonlabel_id -- avoid infinite recursion
555 555
            ;
556 556
        ELSE -- no matched taxonlabel
557
            new.canon_label_id = new.taxonlabel_id; -- make self-reference
557
            new.canon_label_id := new.taxonlabel_id; -- make self-reference
558 558
        END IF;
559 559
    END IF;
560 560
    RETURN new;

Also available in: Unified diff