pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard NAGY <richard@presenceweb.com>
To: Andre Schnabel <A_Schnabel@t-online.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3
Date: Mon, 17 Sep 2001 10:15:20 +0200
Message-ID: <3BA5B118.D4751A2D@presenceweb.com> (raw)
References: <3BA1D7DD.569B218C@presenceweb.com>
	<001901c13d32$10498f80$0201a8c0@aschnabel.homeip.net>
	<3BA24029.BE1B71E1@presenceweb.com>
	<001c01c13d56$09c260a0$0201a8c0@aschnabel.homeip.net>

Andre Schnabel a écrit :

> Hello Richard,
>
> I did some testing and after all your query should be ordered right.
> The test's I have done:
>
> Test=# select t.foo1 from testtable t
> Test-# union
> Test-# select t.foo2 from testtable t
> Test-# order by t.foo1;
> ERROR:  Relation 't' does not exist
>
> -------- Same error as you get ----
>
> Test=# select t.foo1 from testtable t
> Test-# union
> Test-# select t.foo2 from testtable t
> Test-# order by foo1;
>  foo1
> ------
>  abc
>  cdef
> (2 rows)
>
> -------- Ordered Ascending (maybe by chance?) ---
>
> Test=# select t.foo1 from testtable t
> Test-# union
> Test-# select t.foo2 from testtable t
> Test-# order by foo1 DESC;
>  foo1
> ------
>  cdef
>  abc
> (2 rows)
>
> ---- Ordered descending (ordering works!) ---
>
> I guess, the table-alias is not known to the order-clause. Maybe the
> execution (or parsing) order of the UNION changed from 7.0 to 7.1.

Hello Andre,

Thanks very much for having tested. Yes, it works well.

--
Richard NAGY
Presenceweb

view thread (9+ messages)  latest in thread

Message-ID: <3BA5B118.D4751A2D@presenceweb.com>
Permalink:  ../3BA5B118.D4751A2D@presenceweb.com/
Also on:    postgresql.org/message-id/3BA5B118.D4751A2D@presenceweb.com

 · 

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: richard@presenceweb.com, A_Schnabel@t-online.de
  Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3
  In-Reply-To: <3BA5B118.D4751A2D@presenceweb.com>

* 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