Re: make_interval ??

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: make_interval ??
Date: 2013-12-20 23:09:03
Message-ID: 52B4CE0F.7010300@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21/12/13 06:29, Josh Berkus wrote:
> Pavel,
>
>> So constructor should to look like:
>>
>> CREATE OR REPLACE FUNCTION make_interval(years int DEFAULT 0, months int
>> DEFAULT 0, ...)
>>
>> and usage:
>>
>> SELECT make_interval(years := 2)
>> SELECT make_interval(days := 14)
>>
>> Is there a interest for this (or similar) function?
> It would certainly make our Python users happy.
>
> And for that matter would get rid of this kind of stupid thing in stored
> procedure code:
>
> time_ahead := ( interval '1 minute' * var_skip );
>
> So, +1 for the feature.
>
What about leap years?

Cheers,
Gavin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2013-12-20 23:16:30 Re: nested hstore patch
Previous Message Sergey Konoplev 2013-12-20 23:07:37 Re: Hot standby 9.2.6 -> 9.2.6 PANIC: WAL contains references to invalid pages