Re: Charset/collate support and function parameters - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Charset/collate support and function parameters
Date
Msg-id 6799.1099161778@sss.pgh.pa.us
Whole thread Raw
In response to Re: Charset/collate support and function parameters  (Dennis Bjorklund <db@zigo.dhs.org>)
Responses Re: Charset/collate support and function parameters
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Charset/collate support and function parameters
Next
From: Alvaro Herrera
Date:
Subject: Re: 8.0b4: COMMIT outside of a transaction echoes ROLLBACK