--- a/pgsql/create_tables-dovecot-1.2.x.pgsql Tue Feb 08 13:43:35 2011 +0000
+++ b/pgsql/create_tables-dovecot-1.2.x.pgsql Tue Feb 08 18:04:07 2011 +0000
@@ -203,13 +203,15 @@
(SELECT count(gid)
FROM domain_name
WHERE domain_name.gid = domain_data.gid
- AND NOT domain_name.is_primary) AS aliasdomains
+ AND NOT domain_name.is_primary) AS aliasdomains,
+ bytes, messages
FROM domain_data
LEFT JOIN domain_name USING (gid)
+ LEFT JOIN quotalimit USING (qid)
LEFT JOIN transport USING (tid)
LEFT JOIN users USING (gid)
WHERE domain_name.is_primary
- GROUP BY gid, domainname, transport, domaindir;
+ GROUP BY gid, domainname, transport, domaindir, bytes, messages;
CREATE LANGUAGE plpgsql;