| From: | Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> |
|---|---|
| To: | Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> |
| Cc: | peter_e(at)gmx(dot)net, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Proposal: CREATE CONVERSION |
| Date: | 2002-07-09 07:34:30 |
| Message-ID: | 20020709093429.A6517@zf.jcu.cz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Jul 09, 2002 at 10:07:11AM +0900, Tatsuo Ishii wrote:
> > > Use a simple wrap function.
> >
> > How knows this function to/from encoding?
>
> For example you want to define a function for LATIN1 to UNICODE conversion
> function would look like:
>
> function_for_LATIN1_to_UTF-8(from_string opaque, to_string opaque, length
> integer)
> {
> :
> :
> generic_function_using_iconv(from_str, to_str, "ISO-8859-1", "UTF-8",
> length);
> }
>
> CREATE FUNCTION function_for_LATIN1_to_UTF-8(opaque, opaque, integer)
> RETURNS integer;
> CREAE CONVERSION myconversion FOR 'LATIN1' TO 'UNICODE' FROM
> function_for_LATIN1_to_UTF-8;
Hmm, but it require define "function_for_..." for each conversion.
For example trigger function I needn't define for each table, but I can
use only one PostgreSQL function for arbirary table.
Karel
--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christopher Kings-Lynne | 2002-07-09 08:31:57 | Postgres Projects |
| Previous Message | Tatsuo Ishii | 2002-07-09 06:46:40 | Re: Proposal: CREATE CONVERSION |