Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?
Date: 1999-10-19 05:28:55
Message-ID: Pine.GSO.3.96.SK.991019092317.8622I-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks Tom,

I synced REL6_5 tree, compile, install but still query

select a.msg_id, c.status_set_date, c.title
from Message_Keyword_map a, messages c, keywords d
where c.status_id =1 and d.name ~* 'sun' and a.key_id=d.key_id
and c.msg_id=a.msg_id
intersect
select a.msg_id, a.status_set_date, a.title
from messages a where a.status_id = 1 and a.title ~* 'sun' limit 10;

produces more than 10 rows !

Regards,

Oleg

On Tue, 19 Oct 1999, Tom Lane wrote:

> Date: Tue, 19 Oct 1999 00:42:08 -0400
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, pgsql-hackers(at)postgreSQL(dot)org
> Subject: Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?
>
> I wrote:
> > Hmm. It seemed to work as expected in current --- maybe there is
> > another bug still lurking in 6.5.*. I'll look when I get a chance.
>
> Yup, this change that was already in current is also needed:
>
> *** src/backend/parser/gram.y.orig Mon Oct 18 23:59:35 1999
> --- src/backend/parser/gram.y Mon Oct 18 23:55:18 1999
> ***************
> *** 2768,2773 ****
> --- 2768,2775 ----
> /* finally attach the sort clause */
> first_select->sortClause = $2;
> first_select->forUpdate = $3;
> + first_select->limitOffset = nth(0, $4);
> + first_select->limitCount = nth(1, $4);
> $$ = (Node *)first_select;
> }
> if (((SelectStmt *)$$)->forUpdate != NULL && QueryIsRule)
>
>
>
> I have updated both current and REL6_5 branches.
>
> regards, tom lane
>
> ************
>

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-10-19 05:33:09 Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?
Previous Message Tom Lane 1999-10-19 05:05:00 Re: [HACKERS] funny psql output