[HACKERS] Feature request - Add microsecond as a time unit for interval

2006-02-09 Thread David Tulloh
The interval datatype can go to microsecond precision though currently the smallest unit is seconds. Microseconds are represented as decimal places, eg 5 microseconds is 0.05 seconds. To insert microseconds I have to use the following line, ($1*0.01 || ' seconds')::interval Being

Re: [HACKERS] Feature request - Add microsecond as a time unit for interval

2006-02-09 Thread Tom Lane
David Tulloh [EMAIL PROTECTED] writes: To insert microseconds I have to use the following line, ($1*0.01 || ' seconds')::interval Actually, the preferred way to do that is to use the numeric-times-interval operator, eg regression=# select 7 * '0.01 second'::interval; ?column?

Re: [HACKERS] Feature request - Add microsecond as a time unit for interval

2006-02-09 Thread Jim C. Nasby
On Thu, Feb 09, 2006 at 10:30:30AM -0500, Tom Lane wrote: David Tulloh [EMAIL PROTECTED] writes: To insert microseconds I have to use the following line, ($1*0.01 || ' seconds')::interval Actually, the preferred way to do that is to use the numeric-times-interval operator, eg

Re: [HACKERS] Feature request - Add microsecond as a time unit for

2006-02-09 Thread Christopher Kings-Lynne
This generalizes to any scale factor you care to use, eg fortnights... so I don't see a pressing need to add microseconds. Perhaps an argument for adding microseconds to interval declarations is that you can extract them using extract()... Those two lists of allowed scales should be the