pgsql/create_tables-dovecot-1.2.x.pgsql
branchv0.6.x
changeset 515 09fa019bb330
parent 514 d863a44a6353
child 518 5ec2068d02af
equal deleted inserted replaced
514:d863a44a6353 515:09fa019bb330
   194               FROM relocated
   194               FROM relocated
   195              WHERE relocated.gid = domain_data.gid) AS relocated,
   195              WHERE relocated.gid = domain_data.gid) AS relocated,
   196            (SELECT count(gid)
   196            (SELECT count(gid)
   197               FROM domain_name
   197               FROM domain_name
   198              WHERE domain_name.gid = domain_data.gid
   198              WHERE domain_name.gid = domain_data.gid
   199                AND NOT domain_name.is_primary) AS aliasdomains
   199                AND NOT domain_name.is_primary) AS aliasdomains,
       
   200            (SELECT count(gid)
       
   201               FROM catchall
       
   202              WHERE catchall.gid = domain_data.gid) AS catchall
   200       FROM domain_data
   203       FROM domain_data
   201            LEFT JOIN domain_name USING (gid)
   204            LEFT JOIN domain_name USING (gid)
   202            LEFT JOIN users USING (gid)
   205            LEFT JOIN users USING (gid)
   203      WHERE domain_name.is_primary
   206      WHERE domain_name.is_primary
   204   GROUP BY gid;
   207   GROUP BY gid;