Dirk Elmendorf <delmendo(at)rackspace(dot)com> writes:
> select distinct on label label from test;
> ERROR:parser: parse error at or near "label";
The syntax is different in 7.0. Try
select distinct on (label) label from test;
Sorry about the loss of backwards compatibility, but this lets you
select distinct on expressions and even multiple expressions, which
wasn't possible with the old column-name-only syntax...
regards, tom lane