Subject: problem using time intervals

From: [email-masked]
Date: Thu, 4 Mar 93 12:26:48 -0800

Does the time interval stuff described on pp. 23, 24, 28 of the Postgres
reference manual not work, or am I doing something wrong in the following?
The parser doesn't seem to like the [ , ] notation for time intervals.
And the operator <?> described on p. 24 for determining if an abstime
is in a given tinterval isn't recognized.

Shirley Browne
Research Associate
University of Tennessee
Computer Science Department
107 Ayres Hall
Knoxville, TN  37996-1301
(615) 974-3547
[email-masked]

* retrieve (conferences.title) where conferences.oid = mtg_dates.mtgid
and ( (mtg_dates.datedesc="start date" or mtg_dates.datedesc="end date"))
and mtg_dates.date <?> ["Sep 1 1993","Sep 30 1993"]
\g

Query sent to backend is "retrieve (conferences.title) where conferences.oi
d = mtg_dates.mtgid and ( (mtg_dates.datedesc="start date" or mtg_dates.dat
edesc="end date")) and mtg_dates.date <?> ["Sep 1 1993","Sep 30 1993"] "
WARN:Mar  4 11:36:06:Can't find right op: <?> for type 702

* retrieve (conferences.title) where conferences.oid = mtg_dates.mtgid
and ( (mtg_dates.datedesc="start date" or mtg_dates.datedesc="end date"))
and ininterval(mtg_dates.date,["Sep 1 1993","Sep 30 1993"])
\g

Query sent to backend is "retrieve (conferences.title) where conferences.oi
d = mtg_dates.mtgid and ( (mtg_dates.datedesc="start date" or mtg_dates.dat
edesc="end date")) and ininterval(mtg_dates.date,["Sep 1 1993","Sep 30 1993
"]) "
WARN:Mar  4 11:40:45:parser: syntax error at or near "["

Go
* retrieve (conferences.title) where conferences.oid = mtg_dates.mtgid
and ( (mtg_dates.datedesc="start date" or mtg_dates.datedesc="end date"))
and ininterval(mtg_dates.date,"["Sep 1 1993","Sep 30 1993"]")
\g

Query sent to backend is "retrieve (conferences.title) where conferences.oi
d = mtg_dates.mtgid and ( (mtg_dates.datedesc="start date" or mtg_dates.dat
edesc="end date")) and ininterval(mtg_dates.date,"["Sep 1 1993","Sep 30 199
3"]") "
WARN:Mar  4 11:43:04:parser: syntax error at or near "Sep"

Query sent to backend is "create mtg_dates (mtgid=oid,dates=tinterval, subm
it_date=abstime)  "
CREATE
Go
* append mtg_dates (mtgid=135865::oid,dates="["Sep 15 1993","Sep 17 1993"]"
)
\g

Query sent to backend is "append mtg_dates (mtgid=135865::oid,dates="["Sep
15 1993","Sep 17 1993"]") "
WARN:Mar  4 11:53:37:parser: syntax error at or near "Sep"

Go
* retrieve (mtg_dates.all)
\g

Query sent to backend is "retrieve (mtg_dates.all) "
-------------------------------------------
| mtgid       | dates       | submit_date |
-------------------------------------------

Go
* append mtg_dates (mtgid=135865::oid,dates=["Sep 15 1993","Sep 17 1993"])
\g

Query sent to backend is "append mtg_dates (mtgid=135865::oid,dates=["Sep 1
5 1993","Sep 17 1993"]) "
WARN:Mar  4 11:54:53:parser: syntax error at or near "["

Go

Query sent to backend is "retrieve (conferences.title) where (conferences.s
tart_date>="Sep 1 1993" and conferences.start_date<="Sep 30 1993") or (conf
erences.end_date>="Sep 1 1993" and conferences.end_date<="Sep 30 1993") or
(conferences.start_date <= "Sep 1 1993" and conferences.end_date >= "Sep 30
 1993")  "
---------------
| title       |
---------------
| ACM SIGCOMM '93 Conference|
---------------

Go
* retrieve (conferences.title) where [conferences.start_date,conferences.en
d_date] && ["Sep 1 1993","Sep 30 1993"]
\g

Query sent to backend is "retrieve (conferences.title) where [conferences.s
tart_date,conferences.end_date] && ["Sep 1 1993","Sep 30 1993"] "
WARN:Mar  4 12:18:19:parser: syntax error at or near "["