Re: Identifying no-op length coercions - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Identifying no-op length coercions
Date
Msg-id 20110603162740.GB30150@tornado.leadboat.com
Whole thread Raw
In response to Re: Identifying no-op length coercions  (Jim Nasby <jim@nasby.net>)
List pgsql-hackers
On Fri, Jun 03, 2011 at 10:43:17AM -0500, Jim Nasby wrote:
> On Jun 3, 2011, at 10:11 AM, Alexey Klyukin wrote:
> >> Is your interest in cheap varchar(N)->varchar(N+M) conversions specifically, or
> >> in some broader application of this facility?
> > 
> > Exactly varchar conversions.
> 
> Why limit it to varchar? Shouldn't we be able to do this for any varlena? The only challenge I see is numeric; we'd
needto ensure that both size and precision are not decreasing.
 

I've implemented support for varchar, varbit, numeric, time, timetz, timestamp,
timestamptz, and interval.  However, I'll probably submit only varchar in the
initial infrastructure patch and the rest in followup patches in a later CF.

For numeric, we store the display scale in every datum, so any change to it
rewrites the table.  You'll be able to cheaply change numeric(7,2) to
numeric(9,2) but not to numeric(9,3).


pgsql-hackers by date:

Previous
From: Radosław Smogura
Date:
Subject: Streaming solution and v3.1 protocol
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: Domains versus polymorphic functions, redux