Alvaro Herrera <> 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
>               snprintf(res, 64, "%s", fieldstr);

> which puts the parenthised number after the textual name; but the
> grammar only takes it the other way around.

You sure about that?  The grammar for INTERVAL is weird.  I believe
the output we're trying to produce here is something like


where "fieldstr" would be " HOUR TO SECOND" and "precision" would
give the fractional-second precision.

                        regards, tom lane

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to