Project

General

Profile

« Previous | Next » 

Revision 7848

*.sql: concat_ws() calls: Fixed bug where need to surround it with NULLIF because concat_ws() returns '' instead of the required NULL when supplied with only NULL args

View differences:

schema.sql
64 64
  RETURNS trigger AS
65 65
$BODY$
66 66
BEGIN
67
    new."Accepted_scientific_name" = concat_ws(' '
67
    new."Accepted_scientific_name" = NULLIF(concat_ws(' '
68 68
        , NULLIF(NULLIF(new."Accepted_name_family", 'Unknown'), new."Accepted_name")
69 69
        , new."Accepted_name"
70 70
        , new."Accepted_name_author"
71
    );
71
    ), '');
72 72
    new."Max_score" = GREATEST(
73 73
          new."Overall_score"::double precision
74 74
        , new."Family_score"::double precision

Also available in: Unified diff