Weiping He <laser@zhengmai.com.cn> writes:
> laser_uni=# select t1.name, t1.addr, t2.name, t2.len, t2.of from t1
> right join t2 on t1.name=t2.name group by t2.name;
> ERROR: Attribute t1.name must be GROUPed or used in an aggregate function
> seems the I must gorup all those fields:
> is it specification compliant or postgresql specific?
It's spec-compliant according to SQL92.
There is some amazingly complex verbiage in SQL99 that seems intended to
allow the system to deduce that some GROUP BY specs are redundant and
can be omitted. We don't implement that (yet) and I don't think it
would apply to your example anyway, since neither table's name column
is marked as primary key.
regards, tom lane