Dennis Bjorklund <db@zigo.dhs.org> writes:
> On Sat, 30 Oct 2004, Tom Lane wrote:
>> Why would we not keep this information right in the string values?
> We could, but then we would need to parse it every time.
Huh? We'd store it in the most compact pre-parsed form we could think
of; probably some sort of index into a list of supported character sets
and collations. (This is not so different from representing timezones
inside timestamptz values, instead of using a global setting.)
> Are you worried about performance or is it the smaller change that you
> want?
I'm worried about the fact that instead of, say, one length(text)
function, we would now have to have a different one for every
characterset/collation. Not to mention one for every possible N in
varchar(N). Making those properties part of a function's parameter
signature is unworkable on its face --- it'll cause an exponential
explosion in the number of pg_proc entries, and probably make it
impossible to resolve a unique candidate function in many situations.
regards, tom lane