X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B3C80D1B229 for ; Wed, 28 Jul 2004 13:01:50 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20443-08 for ; Wed, 28 Jul 2004 16:01:22 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id D82CBD1B484 for ; Wed, 28 Jul 2004 13:00:37 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1Bpqqw-0004r5-00; Wed, 28 Jul 2004 12:00:26 -0400 To: Tom Lane Cc: Greg Stark , Stephan Szabo , Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: best way to fetch next/prev record based on index References: <6EE64EF3AB31D5448D0007DD34EEB34101AEFF@Herge.rcsinc.local> <20040727204057.S28969@megazone.bigpanda.com> <87oem0u182.fsf@stark.xeocode.com> <21449.1091023621@sss.pgh.pa.us> In-Reply-To: <21449.1091023621@sss.pgh.pa.us> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 28 Jul 2004 12:00:25 -0400 Message-ID: <87y8l4rujq.fsf@stark.xeocode.com> Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/216 X-Sequence-Number: 7607 Tom Lane writes: > The only reason the code in parse_expr.c appears new is that the > functionality used to be in gram.y. Ah, that was what I was missing. Though it's odd since it seems there was code in parse_expr.c to handle the "=" case specially. > I'd like to see this fixed to comply with the spec, but given the lack > of complaints about the existing behavior over so many years, ripping > it out meanwhile doesn't seem appropriate. I tried my hand at this last night and think I did an ok first pass. But I'm missing one piece of the puzzle to get it to compile. What do I need to know to be able to construct a List* suitable for passing as the second arg to make_op() knowing only that I want to create a List* to represent "=" or "<" or so on? I also had another question I didn't ask in the other email. In the midst of a forboth() loop, how would I tell if I'm at the last element of the lists? Would lnext(l)==NULL do it? -- greg