Skip site navigation (1) Skip section navigation (2)

Re: Add protransform for numeric, varbit, and temporaltypes

From: Noah Misch <noah(at)leadboat(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add protransform for numeric, varbit, and temporaltypes
Date: 2012-02-09 12:18:29
Message-ID: 20120209121828.GA3653@tornado.leadboat.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Feb 08, 2012 at 09:37:01AM -0500, Robert Haas wrote:
> On Tue, Feb 7, 2012 at 12:43 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > I've committed the numeric and varbit patches and will look at the
> > temporal one next.
> 
> Committed, after changing the OIDs so they don't conflict.
> 
> Here's one more case for you to ponder:
> 
> rhaas=# create table noah (i interval day);
> CREATE TABLE
> rhaas=# alter table noah alter column i set data type interval second(3);
> DEBUG:  rewriting table "noah"
> ALTER TABLE
> 
> Do we really need a rewrite in that case?  The code acts like the
> interval range and precision are separate beasts, but is that really
> true?

The code has a thinko; a given interval typmod ultimately implies a single
point from which we truncate rightward.  The precision only matters if the
range covers SECOND.  Thanks; the attached patch improves this.

In response to

Responses

pgsql-hackers by date

Next:From: Noah MischDate: 2012-02-09 12:24:49
Subject: Re: Progress on fast path sorting, btree index creation time
Previous:From: Fujii MasaoDate: 2012-02-09 11:02:04
Subject: Re: Scaling XLog insertion (was Re: Moving more work outside WALInsertLock)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group