Re: make_interval ?? - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: make_interval ??
Date
Msg-id 52B47E67.1000205@agliodbs.com
Whole thread Raw
In response to make_interval ??  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: make_interval ??
List pgsql-hackers
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.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Oskari Saarenmaa
Date:
Subject: [PATCH] Make various variables read-only (const)
Next
From: Robert Haas
Date:
Subject: Re: XML Issue with DTDs