Re: Re: Data type confusion - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Re: Data type confusion
Date
Msg-id web-97664@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Re: Data type confusion  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom,

> > Hmmm ... does this mean that I couldn't divide '1 year' by '1
> week'?
> 
> That's exactly what it says.

If that's the case, we'd need to create some sort of function to specify
the time unit to output timestamp operation into:

to_weeks(current_timestamp - hire_date) / '2 weeks'

... otherwise division and multiplication operators for time values
don't do us much good, as we'd be forced to integer-ize all intervals
before we can perform any operations on them at all.

-Josh Berkus


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: [warning: largely off-topic] Re: Data type confusion
Next
From: Allan Engelhardt
Date:
Subject: [warning: largely off-topic] Re: Data type confusion