Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA29434; Tue, 11 Feb 92 10:35:49 -0800
Message-Id: <9202111835.AA29434@postgres.Berkeley.EDU>
From: "M.J.Ridley" <mick@computing.bradford.ac.uk>
Subject: New user help
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
To: postgres@postgres.berkeley.edu
Date: Tue, 11 Feb 92 16:59:06 GMT
X-Mailer: ELM [version 2.3 PL8]



A number of queries,comments,pleas for help from a new Postgres user
Some of these problems may have been aired before but they gave us
trouble attempting to implement what seemed like simple
examples from the documentation.


1) text

In reply to a previous query you wrote that the following will append
to the class word

append word (title="something", document="{borrowed, something, blue}")

cf append manager(name ="marge",employees="{"mike", "alice"}")
from the POSTGRES User Manual.

Both will work, the double quotes inside the braces
in the second example being ignored, however the spaces
preceding something, blue and alice are not ignored
but stored hence these instances can only be retrieved with

retrieve (word.all) where word.document[2]=" something"

not

retrieve (word.all) where word.document[2]="something"

Similarly

retrieve (manager.all) where manager.employees[2] = " alice"

succeeds whilst


retrieve (manager.all) where manager.employees[2] = "alice"

fails.

A further problem with these arrays of arrays is that although
you can use manager.employees[2] in the where qualification
of a retrieve statement you cannot retrieve that array element so

retrieve (manager.employees[2])

fails, although

retrieve (manager.employees[2][2])

and

retrieve (manager.employees[1])
succeed.
In fact   retrieve (manager.employees[2]) hangs the monitor.

2) Time Travel

The manual pages claim Absolute Time is specified

Month Day [Hour:Minute:Second] Year

we can only get a time to be accepted with a full specification
including the Hour:Min:Sec part or using "now".
However when quering versions of classes only the date part
of the time appears to be used.
Therefore when we attempted historical queries we got empty
classes only to retry the queries the next day and find that they
did work!
So is the current granularity of time one day ?
We also found that versions created using "now" were not snapshots
that did not have updates propagated from the base class as suggested
in "The POSTGRES Data Model" but acted like other versions with
updates from the base class propagated to the version.

Also the syntax from the User Manual

retrieve (EMP.salary) using EMP[T] where EMP.name ="Sam"

doesnt work although

retrieve (e.salary) using e in EMP[T] where e.name ="sam"

does.

3) Transitive closure

In a number of places eg Postgres Next-Generation Database
Management System oct 91 Comm ACM it is suggested that you
can explode a parts or ancestor hierachy using a retrieve* syntax
e.g.

retrieve* into answer (parent.older) from a in answer
wher parent.younger = "John" or parent.younger = a.older

We cannot get queries like this to work are we doing something wrong?
Is there an alternative ?



Mick Ridley  mick@uk.ac.bradford.computing
