Skip site navigation (1) Skip section navigation (2)

Re: BETWEEN Help

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,pgsql-patches(at)postgresql(dot)org
Subject: Re: BETWEEN Help
Date: 2002-04-14 18:54:05
Message-ID: 200204141854.g3EIs5Y21438@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Tom Lane wrote:
> "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> > The exact bits I need the advice on really are bits like this:
> 
> >  if (expr_result >= lexpr_result &&
> >                                 expr_result <= rexpr_result)
> 
> > I know this won't work, but how do I make it work?
> 
> You'll need to look up the appropriate comparison operators and call
> them.
> 
> My original thoughts about this involved storing the OIDs of the
> comparison operators in the BETWEEN node (probably in the form of
> Oper sub-nodes, to ease using the existing eval machinery).
> But that isn't the whole story; in some cases, it'll be necessary to
> coerce the inputs into comparable datatypes.

Is there special optimizer/index handling needed for BETWEEN that wasn't
needed before because it was transformed into AND/OR comparisons?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(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

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-04-14 18:54:48
Subject: Re: TOAST index naming consistency
Previous:From: Tom LaneDate: 2002-04-14 18:08:45
Subject: Re: BETWEEN Help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group