Re: QSoC proposal: date_trunc supporting intervals

From: Steve Atkins <steve(at)blighty(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: QSoC proposal: date_trunc supporting intervals
Date: 2014-03-20 20:35:03
Message-ID: 75610ECC-4675-41D9-BCFA-8A8C42EDAA1A@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Mar 20, 2014, at 1:24 PM, Thom Brown <thom(at)linux(dot)com> wrote:

> On 20 March 2014 20:07, Josh Berkus <josh(at)agliodbs(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexandr 2014-03-20 20:41:02 Re: QSoC proposal: date_trunc supporting intervals
Previous Message Josh Berkus 2014-03-20 20:33:47 Re: QSoC proposal: date_trunc supporting intervals