best way to avoid redundant aggregate functions and/or group by columns
If id is defined as the primary key, you can omit grouping by all the foo columns you want for the output as long as you are grouping by the id. This special case of grouping is in accordance with the current SQL standard and has also been covered in the PostgreSQL manual, starting from version 9.1:
When GROUP BY is present, or any aggregate functions are present, it is not valid for the SELECT list expressions to refer to ungrouped columns except within aggregate functions or when the ungrouped column is functionally dependent on the grouped columns, since there would otherwise be more than one possible value to return for an ungrouped column. A functional dependency exists if the grouped columns (or a subset thereof) are the primary key of the table containing the ungrouped column.
(Emphasis added.)
So, if foo.id is the PK, this query would be valid:
select
foo.id,
foo.baz,
foo.whatever,
min(bar.boom) as min_boom
from
foo
join
bar on foo.id = bar.foo_id
group by
foo.id;
PostgreSQL's DISTINCT ON is very elegant and performs very well (often better than aggregates):
select DISTINCT ON (foo.id, foo.baz)
foo.id,
foo.baz,
bar.boom as min_boom
from
foo
join
bar on foo.id = bar.foo_id
ORDER BY
foo.id,
foo.baz,
bar.boom;
Or
select
foo.id,
foo.baz,
x.min_boom
from
foo
join
(select DISTINCT ON (foo_id)
foo_id,
boom as min_boom
from
bar
ORDER BY
foo_id,
boom) x on x.foo_id = foo.id;