pgsql/update_tables_0.5.x-0.6.pgsql
branchv0.6.x
changeset 511 0244f1344b04
parent 503 492c179094c9
child 512 821d3ffaaaca
equal deleted inserted replaced
510:1fa354bbdb90 511:0244f1344b04
   471              WHERE gid = did
   471              WHERE gid = did
   472                AND address = localpart
   472                AND address = localpart
   473             LOOP
   473             LOOP
   474                 RETURN NEXT record;
   474                 RETURN NEXT record;
   475             END LOOP;
   475             END LOOP;
       
   476         IF NOT FOUND THEN
       
   477             FOR record IN
       
   478                 SELECT recipient, destination
       
   479                   FROM catchall
       
   480                  WHERE gid = did
       
   481                 LOOP
       
   482                     RETURN NEXT record;
       
   483                 END LOOP;
       
   484         END IF;
   476         RETURN;
   485         RETURN;
   477     END;
   486     END;
   478 $$ LANGUAGE plpgsql STABLE
   487 $$ LANGUAGE plpgsql STABLE
   479 RETURNS NULL ON NULL INPUT
   488 RETURNS NULL ON NULL INPUT
   480 EXTERNAL SECURITY INVOKER;
   489 EXTERNAL SECURITY INVOKER;