Re: unhelpful error message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: unhelpful error message
Date: 2009-06-18 14:03:21
Message-ID: 6912.1245333801@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

hubert depesz lubaczewski <depesz(at)depesz(dot)com> writes:
> # create table sold_products (items int4, product_id int4);
> # create table products (id int4, codename text);
> # select sp.count, p.codename from sold_products sp join products p on sp.product_id = p.id;

> shown error:
> ERROR: column "p.codename" must appear in the GROUP BY clause or be used in an aggregate function
> LINE 1: select sp.count, p.codename from sold_products sp join produ...
> ^

Per the fine manual, sp.count is another way of writing count(sp).
Does it make more sense now?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2009-06-18 14:06:59 Re: unhelpful error message
Previous Message hubert depesz lubaczewski 2009-06-18 10:21:22 unhelpful error message