agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
Time Queries
2+ messages / 2 participants
[nested] [flat]

* Time Queries
@ 1994-09-01 13:03 David Alan Nelson <D.A.Nelson@newcastle.ac.uk>
  1994-09-01 15:53 ` Re: Time Queries Paul M. Aoki <aoki@cs.berkeley.edu>
  0 siblings, 1 reply; 2+ messages in thread

From: David Alan Nelson @ 1994-09-01 13:03 UTC (permalink / raw)
  To: legacy; +Cc: Neville Smith <n.s.smith@newcastle.ac.uk>

I have a table with a column in it storing time information, i.e. the 
column has type abstime.  In Postgres 4.1, I need to be able to add
a relative time amount on to this, i.e. using the syntax @ '7' "days",
as stated in the reference manual.  

I can not get this to work for either fields of type reltime or type
abstime.  Can anybody tell me how to do this.

Cheers

Dave
-- 

Mail ID : D.A.Nelson@newcastle.ac.uk

Computing Science, University of Newcastle upon Tyne, UK.  (091) 222 8789

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Time Queries
  1994-09-01 13:03 Time Queries David Alan Nelson <D.A.Nelson@newcastle.ac.uk>
@ 1994-09-01 15:53 ` Paul M. Aoki <aoki@cs.berkeley.edu>
  0 siblings, 0 replies; 2+ messages in thread

From: Paul M. Aoki @ 1994-09-01 15:53 UTC (permalink / raw)
  To: David Alan Nelson <D.A.Nelson@newcastle.ac.uk>; +Cc: legacy

"David Alan Nelson" <D.A.Nelson@newcastle.ac.uk> writes:
> I have a table with a column in it storing time information, i.e. the 
> column has type abstime.  In Postgres 4.1, I need to be able to add
> a relative time amount on to this, i.e. using the syntax @ '7' "days",
> as stated in the reference manual.  
> I can not get this to work for either fields of type reltime or type
> abstime.  Can anybody tell me how to do this.

the only operator like this that's built in is timepl, which is 
abstime + reltime.  if you want others, you must write/register 
them yourself.

faerie:aoki (112)> monitor foo
Welcome to the POSTGRES terminal monitor

Go 
* create x (abst = abstime)\g

Query sent to backend is "create x (abst = abstime)"
CREATE
Go 
* append x (abst="now")\g

Query sent to backend is "append x (abst="now")"
APPEND 334138
Go 
* retrieve (x.all)\g

Query sent to backend is "retrieve (x.all)"
---------------
| abst        |
---------------
| Thu Sep 01 15:50:04 1994 GMT|
---------------

Go 
* retrieve (t = x.abst + "@ 7 days"::reltime)\g

Query sent to backend is "retrieve (t = x.abst + "@ 7 days"::reltime)"
---------------
| t           |
---------------
| Thu Sep 08 15:50:04 1994 GMT|
---------------

Go 
*  

--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU"

   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1994-09-01 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1994-09-01 13:03 Time Queries David Alan Nelson <D.A.Nelson@newcastle.ac.uk>
1994-09-01 15:53 ` Paul M. Aoki <aoki@cs.berkeley.edu>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox