Re: Suggested TODO: allow ALTERing of typemods without heap/index rebuild

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Suggested TODO: allow ALTERing of typemods without heap/index rebuild
Date: 2009-06-01 21:39:50
Message-ID: 4A244AA6.4090907@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> Yeah, this has been discussed before; I think it's even in the TODO
> list.

I couldn't find it. At least, not under data types, and also not with
the keyword "typemod". Anyone see it?

> The stumbling block has been to identify a reasonably clean way
> of determining which datatype changes don't require a scan.

Yep. One possibility I'm thinking is supplying a function for each type
which takes two typemods (old and new) and returns a value (none, check,
rebuild) which defines what we need to do: nothing, check but not
rebuild, or rebuild. Default would be rebuild. Then the logic is
simple for each data type.

Note that this doesn't deal with the special case of VARCHAR-->TEXT, but
just with changing typemods. Are there other cases of data *type*
conversions where no check or rebuild is required? Otherwise we might
just special case VARCHAR-->TEXT.

Oh, here's a general case: changing DOMAINs on the same base type should
only be a check, and changing from a DOMAIN to its own base type should
be a none.

--
Josh Berkus
PostgreSQL Experts Inc.
www.pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-06-01 21:58:45 Re: Suggested TODO: allow ALTERing of typemods without heap/index rebuild
Previous Message Guillaume Smet 2009-06-01 21:39:08 Re: Suggested TODO: allow ALTERing of typemods without heap/index rebuild