DISTINCT and ORDER BY bug?

Поиск
Список
Период
Сортировка
От Don Baccus
Тема DISTINCT and ORDER BY bug?
Дата
Msg-id 3.0.1.32.20000206190418.0107cca0@mail.pacifier.com
обсуждение исходный текст
Ответы Re: [HACKERS] DISTINCT and ORDER BY bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
The following used to work in 6.5, works in Oracle, and is
very useful:

donb=# create table foo(c varchar);
CREATE
donb=# insert into foo values('abc');
INSERT 72649 1

donb=# select distinct c from foo order by upper(c);
ERROR:  For SELECT DISTINCT, ORDER BY expressions must appear in target list
donb=# 

In other words, we want to order ignoring case - in this case, users
within the Ars Digita Community system.  We want don baccus to appear
next to Joe Blow rather than following Xena Xenophoba.

Is this now refused because it is non-standard?  It seems a pity...

Of course, one can do "select distinct c, upper(c) as ignore ..."

but that forces the return of more data, so is slower, etc...

BTW the very fact that my testing of our partial port of this web
toolkit under V7 pre-beta has gotten this far is a very good sign.

Among other things, it makes heavy (if simple) use of referential
integrity, which has already uncovered two bugs in the port that
I've fixed.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Case sensitivity issues
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [HACKERS] pg_ctl man page