Re: [HACKERS] is it possible to use LIMIT and INTERSECT ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?
Date
Msg-id 8003.940308128@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] is it possible to use LIMIT and INTERSECT ?  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] mdnblocks is an amazing time sink in huge relations
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] funny psql output