Re: [HACKERS] sign function with INTERVAL?

2016-04-13 Thread Daniel Lenski
On Wed, Apr 13, 2016 at 12:35 PM, Tom Lane wrote: > Jim Nasby writes: >> Actually, after looking at the code for interval_lt, all that needs to >> happen to add this support is to expose interval_cmp_internal() as a >> strict function. It already does exactly what you want. > > interval_cmp() is

[HACKERS] sign function with INTERVAL?

2016-04-13 Thread Daniel Lenski
Hi all, Is there a good reason why the SIGN() function does not work with the INTERVAL type? (It is only defined for numeric types.) (http://www.postgresql.org/docs/9.5/static/functions-math.html) select sign(-3); -- okay select sign(interval '4 years'); -- ERROR: function sign(interval) does not