Wishlist for next version: group by clause - Mailing list pgsql-hackers

From Edmund Mergl
Subject Wishlist for next version: group by clause
Date
Msg-id 3582BFEE.A0EE9C05@bawue.de
Whole thread Raw
Responses Re: [HACKERS] Wishlist for next version: group by clause  (De Clarke <de@ucolick.org>)
List pgsql-hackers
Hi,

currently I'm writing a Web application, which should
be able to interface to any SQL database. Using perl this
seems to be straigt forward, mainly due to the DBI module
of Tim Bunce. What makes this task really difficult are
the SQL-dialects of every database. Although SQL is
standardized, there are many, subtle differences which have
to be taken into account. After stripping down my application
to an absolut basic syntax, there is still one problem left.

PostgreSQL understands the following syntax:

  select count(SUBSTR(var,1,5)),      SUBSTR(var,1,5)      from t group by 2;
  select count(SUBSTR(var,1,5)) as x, SUBSTR(var,1,5) as y from t group by y;

Unfortunately other databases - like Oracle - are not able to
handle these statements. Oracle understands only the following syntax:

  select count(SUBSTR(var,1,5)), SUBSTR(var,1,5) from t group by SUBSTR(var,1,5);

which gives an error with PostgreSQL !


I don't know if any of these variants are standard or non-standard,
but it would be very helpful, if PostgreSQL would be able to
handle all of these examples. From the functional point of view,
there is no difference. I guess, only the parser has to be adapted.


Edmund
--
Edmund Mergl          mailto:E.Mergl@bawue.de
Im Haldenhau 9        http://www.bawue.de/~mergl
70565 Stuttgart       fon: +49 711 747503
Germany

pgsql-hackers by date:

Previous
From: Peter T Mount
Date:
Subject: Re: [HACKERS] [QUESTIONS] builtin lo_unlink(int4)? why int4 not oid?
Next
From: Bruce Momjian
Date:
Subject: Re: [BUGS] NOTICE:AbortTransaction and not in in-progress state