Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA29787; Sun, 24 May 92 10:16:02 -0700
Message-Id: <9205241716.AA29787@postgres.Berkeley.EDU>
From: <mao@postgres.berkeley.edu>
Subject: Re: sort by syntax/semantics
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Sat, 23 May 92 17:18:03 PST.
             <9205240018.AA24328@postgres.Berkeley.EDU> 
Date: Sun, 24 May 92 10:24:05 PDT

In message <9205240018.AA24328@postgres.Berkeley.EDU> you write:

> Is there some reason that the 'sort by' is restricted to simple
> attribute names?

no, the grammar just doesn't contain productions for more complex
sort specs.

> Is this a known bug?  Can it be fixed?  This is an annoying problem
> when doing a retrieve of the form:
>
>	retrieve (a.node, b.node, c.node, ...) from a, b, c in graph
>	where ... sort by ...
> 
> and you want to sort by more than one attribute with the same name.  

i don't consider it a bug.  you can express the query above as

	retrieve (a.node, b.node, sortexpr = c.node, ...) ...
	sort by sortexpr

the rhs of the sortexpr assignment in the target list can be an
arbitrarily complex expression.  see the reference manual for
details.
					mike olson
					postgres research group
					uc berkeley
					mao@cs.berkeley.edu
