pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wieck@debis.com
To: herouth@oumail.openu.ac.il
Cc: michaely@alphanet.net.au
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Order by
Date: Wed, 2 Jun 1999 12:45:48 +0200 (MET DST)
Message-ID: <m10p8Wq-0003kGC@orion.SAPserv.Hamburg.dsh.de> (raw)
In-Reply-To: <l03130302b37aaa3d3da3@[147.233.159.109]>

Herouth Maoz wrote:
>
> At 03:48 +0300 on 02/06/1999, Michael Yeung wrote:
>
>
> > Hi all,
> >
> > Is anyone know that if we allow order-by clause in the view structure.
> > If not, how can we take the ordering of the UNION ALL in 2 different bags ?
>
> Correct me if I'm wrong, but ORDER BY shoud not be part of a view, in the
> same way it is not a part of a table. A table is defined as an unordered
> collection of tuples. In any given query, you can define the order of the
> tuples returned. But the table itself is not ordered.
>
> A view should look to the user just like a table. The order of the tuples
> is part of the query, not part of the table, and not part of the view.

    That's all right and I'm not going to allow this just for the
    ORDER BY.  It will be enabled  as  kind  of  a  side  effect.
    Because   view's   can   have   a   GROUP   BY   clause,  the
    rewriter/planner  must  be  able  to  produce   plans   where
    different  left-/righttrees have their own grouping. Grouping
    requires  a  sort  and  thus  sorting  of  subplans  must  be
    supported.

    Why should we deny ORDER BY on views explicitly?


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #





view thread (18+ messages)  latest in thread

Message-ID: <m10p8Wq-0003kGC@orion.SAPserv.Hamburg.dsh.de>
Permalink:  ../m10p8Wq-0003kGC@orion.SAPserv.Hamburg.dsh.de/
Also on:    postgresql.org/message-id/m10p8Wq-0003kGC@orion.SAPserv.Hamburg.dsh.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: wieck@debis.com, herouth@oumail.openu.ac.il, michaely@alphanet.net.au
  Subject: Re: [SQL] Order by
  In-Reply-To: <m10p8Wq-0003kGC@orion.SAPserv.Hamburg.dsh.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox