Re: [HACKERS] interval typmodout is broken

2014-10-18 Thread Bruce Momjian
On Mon, Oct 13, 2014 at 07:38:39PM -0400, Bruce Momjian wrote: I think the basic problem is that the original author had the idea of doing: SELECT INTERVAL (2) '100. seconds'; interval -- 00:01:41 and using (2) in that location as a short-hand when

Re: [HACKERS] interval typmodout is broken

2014-10-13 Thread Bruce Momjian
On Thu, Sep 25, 2014 at 12:06:56AM -0400, Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: You sure about that? The grammar for INTERVAL is weird. Well, I tested what is taken on input, and yes I agree the grammar is weird (but not more weird than

[HACKERS] interval typmodout is broken

2014-09-24 Thread Alvaro Herrera
I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision); else snprintf(res, 64, %s, fieldstr); which

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision); else

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera alvhe...@2ndquadrant.com writes: I just noticed when working on DDL deparsing that the typmodout routine for intervals is broken. The code uses if (precision != INTERVAL_FULL_PRECISION) snprintf(res, 64, %s(%d), fieldstr, precision);

Re: [HACKERS] interval typmodout is broken

2014-09-24 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Tom Lane wrote: You sure about that? The grammar for INTERVAL is weird. Well, I tested what is taken on input, and yes I agree the grammar is weird (but not more weird than timestamp/timestamptz, mind). The input function only accepts the