Re: Character set conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bastiaan Olij <lists(at)basenlily(dot)nl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Character set conversion
Date: 2008-07-21 14:16:40
Message-ID: 12836.1216649800@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bastiaan Olij <lists(at)basenlily(dot)nl> writes:
> I read in the documentation about the 'Create conversion' command
> writing a function to do the conversion job. Is this the best way
> forward or are there better ways to attempt this? Is there any sample
> code available for implementing such a conversion? I don't want to
> reinvent the wheel here...

Look into the PG source code under
src/backend/utils/mb/conversion_procs.

While an add-on conversion procedure isn't too hard, I don't think
there's any way to define a whole new encoding without modifying the
source code --- the encodings are listed in some hard-coded tables
in the C code rather than being defined by a system catalog. It
wouldn't be too hard if you don't mind running a custom Postgres
build; but if you do, then the best answer might be to cannibalize
one of the existing encoding names and just replace its conversion
procedures.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Wright, George 2008-07-22 20:00:32 libpq question
Previous Message Bastiaan Olij 2008-07-21 06:48:22 Character set conversion