LIMIT and UNION

Started by Chris Bitmeadover 26 years ago4 messages
#1Chris Bitmead
chris@tech.com.au

Is it a known problem that LIMIT doesn't work with UNION, or have I
discovered a bug?

--
Chris Bitmead
mailto:chris@tech.com.au
http://www.techphoto.org - Photography News, Stuff that Matters

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Chris Bitmead (#1)
Re: [HACKERS] LIMIT and UNION

Chris Bitmead <chris@tech.com.au> writes:

Is it a known problem that LIMIT doesn't work with UNION, or have I
discovered a bug?

Not sure, but I think the LIMIT would be parsed as an attribute of
one or the other of the sub-selects, not as a limit on the total
result size. This is probably not the behavior you want :-(

regards, tom lane

#3Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Chris Bitmead (#1)
Re: [HACKERS] LIMIT and UNION

Is it a known problem that LIMIT doesn't work with UNION, or have I
discovered a bug?

I see. Syntax is accepted, but LIMIT is not performed. Looks like a
bug.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Chris Bitmead (#1)
Re: [HACKERS] LIMIT and UNION

Is it a known problem that LIMIT doesn't work with UNION, or have I
discovered a bug?

Added to TODO:

* UNION with LIMIT fails

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026