Return-Path: avi
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA09301; Wed, 4 Aug 93 13:58:14 -0700
Date: Wed, 4 Aug 93 13:58:14 -0700
Message-Id: <9308042058.AA09301@postgres.Berkeley.EDU>
From: Avi Pfeffer <avi@postgres.Berkeley.EDU>
Subject: Re: Postgres 4.0.1, having problems with dates and indexing
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Aaron, a couple of comments.

First of all, "1 hour" is not the correct syntax for reltimes.  You
need to say "@ 1 hour".  Also, there was a bug of unknown vintage that
made timemi and timepl expect to take two abstimes.  The reason the
bug wasn't discovered till now is that most people use the + and -
operators, and the operators were defined correctly.  You will also
probably find it easier to use them.

I have absolutely no idea why the tinterval query should have caused
postgres to crash.  Try it again with 4.1.  It works fine for me.

avi

Script follows :
Welcome to the POSTGRES terminal monitor

Go 
* retrieve (x = "Aug 12 10:00:00 1990 GMT"::abstime + "@ 1 hour"::reltime)
\g
Query sent to backend is "retrieve (x = "Aug 12 10:00:00 1990 GMT"::abstime + "@ 1 hour"::reltime)  retrieve (x = "Aug 12 10:00:00 1990 GMT"::abstime - "@ 1 hour"::reltime)  retrieve (x = "['Aug 12 10:00:00 1990 GMT' 'Aug 14 10:00:00 1990 GMT']"::tinterval)"
---------------
| x           |
---------------
| Sun Aug 12 03:00:00 1990 PDT|
---------------

Go
* retrieve (x = "Aug 12 10:00:00 1990 GMT"::abstime - "@ 1 hour"::reltime)
\g
---------------
| x           |
---------------
| Sun Aug 12 01:00:00 1990 PDT|
---------------


Go
* retrieve (x = "['Aug 12 10:00:00 1990 GMT' 'Aug 14 10:00:00 1990 GMT']"::tinterval)\g
\g
---------------
| x           |
---------------
| ['Sun Aug 12 02:00:00 1990 PDT' 'Tues Aug 14 02:00:00 1990 PDT']|
---------------

Go 
* 

