Home > Archive > PostgreSQL Bugs > December 2005 > BUG #2097: Union bug.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author BUG #2097: Union bug.
Evan Carroll

2005-12-07, 7:25 am


The following bug has been logged online:

Bug reference: 2097
Logged by: Evan Carroll
Email address: personal@evancarroll
.com
PostgreSQL version: 8.1
Operating system: Linux -- Debian & Ubuntu.
Description: Union bug.
Details:

There apears to be a bug with the Union feature in 8.1. If nothing else it
is an oddity to be recognized. The naming from the result table seems to be
from the first select of the union but it only accepts the second column to
be named identically and misleadingly to the first.

"select col1 as x col1 from tab1 union select * from tab2' and it selects
the first and second column from both tables

IE Here is the exact querry
select fkey_event as F, fkey_event from event_contact UNION select * from
event_object ORDER BY fkey_event;

and here is the header from the outputted table
f | fkey_event
-----+------------

But yet the rows are not the same, they correspond to the natural order of
the sql union, where f is the first col of tbl1+ tbl2, and fkey_event is the
second column of tbl1+tbl2.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Tom Lane

2005-12-07, 9:24 am

"Evan Carroll" < personal@evancarroll
.com> writes:
> IE Here is the exact querry
> select fkey_event as F, fkey_event from event_contact UNION select * from
> event_object ORDER BY fkey_event;


> and here is the header from the outputted table
> f | fkey_event
> -----+------------


And? I don't see anything wrong with that.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com