Re: Recent updates - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Recent updates
Date
Msg-id 199807141701.NAA25918@candle.pha.pa.us
Whole thread Raw
In response to Re: Recent updates  ("Thomas G. Lockhart" <lockhart@alumnus.caltech.edu>)
List pgsql-hackers
> > > Any ideas?
> > I knew there was a reason I did not support NULL in union.  :-)
>
> Yeah, it's sticky. Where in the code does the sorting get set up?
>
>                            - Tom
>

See optimizer/prep/prepunion.c::plan_union_queries().  You will see me
calling transformSortClause() from there to set up a query using
UNION/UNION ALL.  I think that is where the problem is happening.
Whatever you did in the parser to get these types converted is not in
that function.  Can you check into it?  Should I be doing that in
another place.  I am unsure, but it looks like the best place for it.

I think the major problem is the way I am re-ordering the UNION sort to
handle the placement of UNION and UNION ALL.  I think I need some more
code, or perhaps grab some structure you are already populating in the
parser in this place.

When I required all the types to be the same, it didn't matter how I
re-ordered things.



--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] atttypmod now 32 bits, interface change]
Next
From: Tom Lane
Date:
Subject: EXPLAIN doesn't explain operations on inheritance trees