create_optional_types_and_functions.pgsql
changeset 82 6c85915f3815
parent 75 af813ede1e19
child 102 485d3f7d6981
--- a/create_optional_types_and_functions.pgsql	Wed Sep 10 00:00:37 2008 +0000
+++ b/create_optional_types_and_functions.pgsql	Thu Sep 11 20:38:30 2008 +0000
@@ -48,8 +48,8 @@
             FOR rec IN
                 SELECT DISTINCT sender, destination
                   FROM alias
-                       LEFT JOIN domain_name USING (gid)
-                 WHERE alias.address = localpart
+                 WHERE alias.gid = did
+                   AND alias.address = localpart
                 LOOP
                     RETURN NEXT rec;
                 END LOOP;