Re: [HACKERS] union and LIMIT problem

From: wieck(at)debis(dot)com (Jan Wieck)
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: oleg(at)sai(dot)msu(dot)su, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] union and LIMIT problem
Date: 1999-10-07 10:00:22
Message-ID: m11ZALW-0003kLC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:

>
> > Does anybody know how to use UNION and LIMIT together ?
> > I want to get 10 rows from publications and 10 rows
> > from keys.
> >
> > select msg_id from publications limit 10 union
> > select key_id from keys limit 10
> > produces
> > ERROR: parser: parse error at or near "union
> >
> > select msg_id from publications union
> > select key_id from keys limit 10
> > produces something I wasn't expected
>
> I have on the TODO list:
>
> * UNION with LIMIT fails

and must fail by it's implementation. LIMIT is handled by the
outermost executor loop, suppressing OFFSET result tuples and
stopping execution after LIMIT results sent to the client.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zakkr 1999-10-07 10:48:11 RE: [HACKERS] password in pg_shadow
Previous Message Hiroshi Inoue 1999-10-07 09:56:52 Scan by TID (was RE: [HACKERS] How to add a new build-in operator)