Skip site navigation (1) Skip section navigation (2)

Re: SQL request change when upgrade from 7.0.2 to 7.1.3

From: Richard NAGY <richard(at)presenceweb(dot)com>
To: Andre Schnabel <A_Schnabel(at)t-online(dot)de>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3
Date: 2001-09-17 08:15:20
Message-ID: 3BA5B118.D4751A2D@presenceweb.com (view raw or flat)
Thread:
Lists: pgsql-sql
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


In response to

pgsql-sql by date

Next:From: Richard NAGYDate: 2001-09-17 08:27:53
Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3
Previous:From: Richard NAGYDate: 2001-09-17 07:45:27
Subject: Re: SQL request change when upgrade from 7.0.2 to 7.1.3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group