pgsql/update_tables_0.5.x-0.6.pgsql
branchv0.6.x
changeset 515 09fa019bb330
parent 514 d863a44a6353
child 518 5ec2068d02af
equal deleted inserted replaced
514:d863a44a6353 515:09fa019bb330
   166               FROM relocated
   166               FROM relocated
   167              WHERE relocated.gid = domain_data.gid) AS relocated,
   167              WHERE relocated.gid = domain_data.gid) AS relocated,
   168            (SELECT count(gid)
   168            (SELECT count(gid)
   169               FROM domain_name
   169               FROM domain_name
   170              WHERE domain_name.gid = domain_data.gid
   170              WHERE domain_name.gid = domain_data.gid
   171                AND NOT domain_name.is_primary) AS aliasdomains
   171                AND NOT domain_name.is_primary) AS aliasdomains,
       
   172            (SELECT count(gid)
       
   173               FROM catchall
       
   174              WHERE catchall.gid = domain_data.gid) AS catchall
   172       FROM domain_data
   175       FROM domain_data
   173            LEFT JOIN domain_name USING (gid)
   176            LEFT JOIN domain_name USING (gid)
   174            LEFT JOIN users USING (gid)
   177            LEFT JOIN users USING (gid)
   175      WHERE domain_name.is_primary
   178      WHERE domain_name.is_primary
   176   GROUP BY gid;
   179   GROUP BY gid;