unhelpful error message

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема unhelpful error message
Дата
Msg-id 20090618102122.GA11915@depesz.com
обсуждение исходный текст
Ответы Re: unhelpful error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi,
I tested it on 8.3.7 and on 8.4, but it doesn't seem to be version
bound.

steps to reproduce:

# 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...
                         ^

Now - the problem is that I "forgot" name of the column, thought it will be "count", but it's "items".

the error doesn't say that I used column that doesn't exist - it says something about grouping.

I know it is related to the fact that this works:

select sp.count from sold_products sp;

but i'm not sure if it this (rather obscure) functionality is really worth the trouble.

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] Cannot use all four trigger events at once
Следующее
От: Tom Lane
Дата:
Сообщение: Re: unhelpful error message