Re: [HACKERS] union and LIMIT problem - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] union and LIMIT problem
Date
Msg-id 18929.943929288@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] union and LIMIT problem  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] union and LIMIT problem
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Can I assume this is fixed?  I see it marked on the TODO list.

Yes, I think it is (barring a counterexample from someone ... the
UNION rewriter is awfully crufty ...).

It might be nice to allow LIMIT to be attached to subselects rather
than just the top level, but I have no idea what it would take in the
executor to implement that.  I could handle fixing the parser & planner
if someone else wants to fix it in the executor.

>> Does anybody know how to use UNION and LIMIT together ?
>> 
>> select msg_id from publications union 
>> select key_id from keys         limit 10
>> produces something I wasn't expected
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bug
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] IN clause and INTERSECT not behaving as expected