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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers