Re: SQL feature requests

From: "Zeugswetter Andreas ADI SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
To: "Michael Glaesemann" <grzm(at)seespotcode(dot)net>, "Ben Tilly" <btilly(at)gmail(dot)com>
Cc: "Gregory Stark" <stark(at)enterprisedb(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL feature requests
Date: 2007-08-23 07:54:36
Message-ID: E1539E0ED7043848906A8FF995BDA579024F46A8@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > If your implementation accepts:
> >
> > group by case when true then 'foo' end

I think he meant: group by case when true then "foo" end

>
> What would that mean? Regardless of whether or not it's accepted, it
> should have *some* meaning.
>
> It's not equivalent to GROUP BY "foo"

Yea, but only because 'foo' is an identifier, and not a string constant.

> test=# select record_id as foo
> , count(observation_id) as bar
> from observation
> group by case when true
> then 'foo'
> end;
> ERROR: column "observation.record_id" must appear in the GROUP BY
> clause or be used in an aggregate function

I think your example would be easier to understand if you removed the
quotes.
We don't detect the correctness of the above query. You can hardly say
that
this is a feature, but I am not inclined to see it as a troublesome bug
eighter.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas ADI SD 2007-08-23 08:00:27 Re: SQL feature requests
Previous Message Chuck McDevitt 2007-08-23 07:19:19 Re: SQL feature requests