Re: interval typmodout is broken

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: interval typmodout is broken
Дата
Msg-id 30048.1411591455@sss.pgh.pa.us
обсуждение исходный текст
Ответ на interval typmodout is broken  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: interval typmodout is broken  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@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
>         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
INTERVAL HOUR TO SECOND(2)

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: missing isinf declaration on solaris
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Review of GetUserId() Usage