Re: [HACKERS] union and LIMIT problem

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <wieck(at)debis(dot)com>
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 16:36:57
Message-ID: 199910071636.MAA01976@candle.pha.pa.us
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.

Ah, but it works sometimes:

test=> select * from pg_language union select * from pg_language limit 1;
lanname|lanispl|lanpltrusted|lanplcallfoid|lancompiler
-------+-------+------------+-------------+-----------
|t |f |f | 0|/bin/cc
(1 row)

so we would need to get it working, or disable it from happening.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-10-07 16:38:50 Re: [HACKERS] password in pg_shadow
Previous Message Bruce Momjian 1999-10-07 16:35:19 Re: Scan by TID (was RE: [HACKERS] How to add a new build-in operator)