Re: [INTERFACES] How does operation with data types time???

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Pablo Saul Salazar - CESERCOMP <ssalazar(at)goliat(dot)espol(dot)edu(dot)ec>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] How does operation with data types time???
Date: 1999-07-01 02:45:50
Message-ID: 377AD65E.353EFEB2@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> 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(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Thomas Lockhart 1999-07-01 02:48:45 Re: [INTERFACES] Reply-To: missing
Previous Message Tom Lane 1999-07-01 00:26:39 Re: [INTERFACES] lo_export & pgaccess