Re: make_interval ??

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: make_interval ??
Date: 2013-12-20 17:29:11
Message-ID: 52B47E67.1000205@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2013-12-20 17:30:55 Re: pg_upgrade & tablespaces
Previous Message Oskari Saarenmaa 2013-12-20 17:01:37 [PATCH] Make various variables read-only (const)