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

Re: FWD: tinterval vs interval on pgsql-novice

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: FWD: tinterval vs interval on pgsql-novice
Date: 2000-11-28 17:20:48
Message-ID: 3A23E970.8EE1C84B@alumni.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-novice
Tom Lane wrote:
> 
> Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> writes:
> >> I see it does fail, but I'm at a complete loss to understand why,
> >> especially given that the first case still works.  The grammar looks
> >> perfectly fine AFAICT.  Can you explain what's wrong here?
> 
> > Here is what I'm planning on doing (already tested, but not committed).
> > I'm adding some productions to the func_name rule in gram.y to handle
> > the various "stringy operators" such as LIKE and OVERLAPS. These tokens
> > will also be allowed in the ColLabel rule (as several are already).
> > This fixes the immediate problem, and makes LIKE handling more
> > consistant with other special functions. Comments?
> That all sounds fine, but it doesn't seem to fix the problem I'm looking
> at, which is that the OVERLAPS production is broken in current sources:

Yes it does. When you execute

  select (timestamp 'today', interval '1 day')
   OVERLAPS (timestamp 'yesterday', timestamp 'tomorrow');

This is matched up with an entry in pg_proc which declares an SQL
language implementation as

  'select overlaps($1, ($1+$2), $3, $4)'

which is what fails.

It may be better to declare this as

  'select ($1, ($1+$2)) overlaps ($3, $4)'

but that is not what is there now. I've just tested the latter form and
it seems to work, so I'll include that in my next patchball.

                      - Thomas

In response to

pgsql-novice by date

Next:From: Thomas LockhartDate: 2000-11-28 18:07:45
Subject: Re: Re: FWD: tinterval vs interval on pgsql-novice
Previous:From: Peter EisentrautDate: 2000-11-28 17:16:47
Subject: Re: Re: FWD: tinterval vs interval on pgsql-novice

pgsql-hackers by date

Next:From: Thomas LockhartDate: 2000-11-28 18:07:45
Subject: Re: Re: FWD: tinterval vs interval on pgsql-novice
Previous:From: Peter EisentrautDate: 2000-11-28 17:16:47
Subject: Re: Re: FWD: tinterval vs interval on pgsql-novice

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