Re: Conversion Questions

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: peter_e(at)gmx(dot)net
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Conversion Questions
Date: 2002-09-21 00:39:58
Message-ID: 20020921.093958.32743877.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Is there ever a need to have more than one conversion for a given
> combination of encodings?

Sure. For example, several Unicode and SJIS mappings exist depending
on vendors or standards. M$ has its own, Apple has another one...
If a user want to employ Apple's map, he could define his own implicit
conversion.

> And if I have more than one combination
> registered, which one is used by the implicit server/client conversion?

That depends on current name space. You could find such an example in
the conversion regression test. Note that you cannot define more than
one implicit conversion for a schema/server encoding/client encoding
combination.

> Also, if my server encoding is A and my client encoding is B, and I do
>
> SELECT convert('some string' using a_to_c); -- not B
>
> or even
>
> SELECT convert('some string' using e_to_f);
>
> this would surely lead to bogus results?

Yes. Choosing right conversion is callers responsibilty.

> What's the use of all this?

One example. A user wants to apply lower() to Unicode database.

select convert(lower(convert('X' using utf_8_to_iso_8859_1)) using iso_8859_1_to_utf_8);
--
Tatsuo Ishii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Curt Sampson 2002-09-21 04:16:42 Re: PGXLOG variable worthwhile?
Previous Message Peter Eisentraut 2002-09-20 23:43:48 Conversion Questions