Re: QSoC proposal: date_trunc supporting intervals - Mailing list pgsql-hackers

From Steve Atkins
Subject Re: QSoC proposal: date_trunc supporting intervals
Date
Msg-id 75610ECC-4675-41D9-BCFA-8A8C42EDAA1A@blighty.com
Whole thread Raw
In response to Re: QSoC proposal: date_trunc supporting intervals  (Thom Brown <thom@linux.com>)
Responses Re: QSoC proposal: date_trunc supporting intervals  (Alexandr <askellio@gmail.com>)
List pgsql-hackers
On Mar 20, 2014, at 1:24 PM, Thom Brown <thom@linux.com> wrote:

> On 20 March 2014 20:07, Josh Berkus <josh@agliodbs.com> wrote:
>> On 03/20/2014 09:56 AM, Alexandr wrote:
>>> Here is the text of my proposal which I've applied to GSoC.
>>> (and link
>>> https://docs.google.com/document/d/1vBjQzhFT_fgoIkoEP5TVeyFA6ggsYlLq76tghGVUD6A/edit?usp=sharing)
>>>
>>> Any suggestions and comments are welcome.
>>> Because I don't know the code of PostgreSQL well I decide not to
>>> participate is QSoC with previous proposal (rewrite pg_dump and
>>> pg_restore as libraries). But I'm very interested to participate in QSoC
>>> 2014 as a part of PostgreSQL. So It's my new proposal.
>>
>> Per my comments on the GSOC app, it looks good, but I'd like to see some
>> "stretch goals" if you are able to implement the new function before
>> GSOC is over.  For example, one thing which has been frequently
>> requested is functions to display intervals in the unit of your choice
>> ... for example, convert "1 day" to "14400 seconds".
>
> +1
>
> This is definitely something I've wanted in the past, like getting the
> number of minutes between 2 timestamps without converting to seconds
> since epoch then doing a subtraction.

It’d be nice, but isn’t it impossible with anything similar to the existing interval
type (as you lose data when you convert to an interval that you can’t get back)?

Subtracting to get an interval, then converting that interval to seconds or minutes
could give you a value that’s wildly different from the right answer.

Cheers, Steve




pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: QSoC proposal: date_trunc supporting intervals
Next
From: Alexandr
Date:
Subject: Re: QSoC proposal: date_trunc supporting intervals