Try the following:
SELECT sum(a.total) FROM (SELECT sum(size) as total FROM mytable group by name) a
UPDATE Sorry, I did not read that you want all in one request. For this reason, greg's answer is better. However, another possibility, if you have a version of postgresql> = 9:
WITH mytableWith (name, sum) as (SELECT name, sum(size) FROM mytable GROUP BY name) SELECT 'grand total' AS name, sum(sum) AS sum FROM mytableWith UNION ALL SELECT name, sum FROM mytableWith
doctore
source share