pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Lockhart <lockhart@alumni.caltech.edu>
To: Pablo Saul Salazar - CESERCOMP <ssalazar@goliat.espol.edu.ec>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] How does operation with data types time???
Date: Thu, 01 Jul 1999 02:45:50 +0000
Message-ID: <377AD65E.353EFEB2@alumni.caltech.edu> (raw)
References: <Pine.GSO.3.96.990630082752.21070A-100000@goliat.espol.edu.ec>

> I have another question, please should someone help me??

Sure. I understand this one, but didn't quite follow the previous
question. Sorry...

> How may does operation in fields of type "time"??
> for example , i want does the following query:
>  lab=>update ctrl set curren_time = current_time - 3;
> is tell o want subtract three minutes to values in field current_time that
> is of tipe time,

It looks to me that we are missing a math routine to make this
transparent (at least once you make the "3" into "timespan '3 min'").
But there is a workaround:

postgres=> select time(datetime('today', time '3:30') - timespan '3
min');
time    
--------
03:27:00
(1 row)

Hope this helps...

                        - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California



view thread (2+ messages)

Message-ID: <377AD65E.353EFEB2@alumni.caltech.edu>
Permalink:  ../377AD65E.353EFEB2@alumni.caltech.edu/
Also on:    postgresql.org/message-id/377AD65E.353EFEB2@alumni.caltech.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: lockhart@alumni.caltech.edu, ssalazar@goliat.espol.edu.ec
  Subject: Re: [INTERFACES] How does operation with data types time???
  In-Reply-To: <377AD65E.353EFEB2@alumni.caltech.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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