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

select ... union select ... order by fails in 7.1

From: Palle Girgensohn <girgen(at)partitur(dot)se>
To: pgsql-bugs(at)postgresql(dot)org
Subject: select ... union select ... order by fails in 7.1
Date: 2001-04-22 22:05:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

I'm not certain this is correct SQL, and I know the rewrite is
easy, but here is a difference I found between 7.0.3 and 7.1:

select from users a 
select from oldusers a
order by a.userid;

ERROR:  Relation 'a' does not exist

This works fine in postgres 7.0.x

the simple rewrite is of course 'order by userid', but it is
tedious to find all places in our system where this happens. It
seems some programmers have used the above syntax a lot :(

Is it a bug, or was it a feature in 7.0?

         Partitur Informationsteknik AB    
Wenner-Gren Center             +46 8 566 280 02  
113 46 Stockholm	       +46 70 785 86 02  
Sweden			       girgen(at)partitur(dot)se

pgsql-bugs by date

Next:From: Rainer MagerDate: 2001-04-22 23:48:18
Subject: RE: 7.0.3 dumps aren't accessible via JDBC in 7.1
Previous:From: Tom LaneDate: 2001-04-22 19:30:08
Subject: Re: An statement causes postmaster to die

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