interval typmodout is broken - Mailing list pgsql-hackers

From Alvaro Herrera
Subject interval typmodout is broken
Date
Msg-id 20140924203114.GS5311@eldon.alvh.no-ip.org
Whole thread Raw
Responses Re: interval typmodout is broken  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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.

This has been wrong since commit 5725b9d9afc8 dated Dec 30 2006, which
introduced the whole notion of type-specific typmod output functions.
I don't understand how come nobody has noticed this in eight years.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: missing isinf declaration on solaris
Next
From: Stephen Frost
Date:
Subject: Re: RLS feature has been committed