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-11 08:14:28 |
Message-ID: | 20020711101427.D1895@zf.jcu.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jul 11, 2002 at 03:37:49PM +0900, Tatsuo Ishii wrote:
> > > 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.
>
> I don't think this is a big problem, IMO.
>
> However, thinking more, I came to a conclusion that passing encoding
> ids would be a good thing. With the encoding id parameters, the
> function could check if it is called with correct encodings, and this
> would prevent disaster. New interface proposal:
OK.
> pgconv(
> INTEGER, -- source encoding id
> INTEGER, -- destination encoding id
Where/how is describe conversion between encoding id and encoding
name? (I maybe something overlook:-) I expect new encoding system
will extendable and encodings list not will hardcoded like now.
(extendable = add new encoding without PostgreSQL rebuild)
BTW, the client site needs routines for work with encoding names too
(pg_char_to_encoding()). Hmm.. it can't be extendable, or yes?
> OPAQUE, -- source string (null terminated C string)
> OPAQUE, -- destination string (null terminated C string)
> INTERGER -- source string length
> ) returns INTEGER; -- dummy. returns nothing, actually.
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 | Tatsuo Ishii | 2002-07-11 08:26:01 | Re: Proposal: CREATE CONVERSION |
Previous Message | Tatsuo Ishii | 2002-07-11 07:57:12 | new SQL command: CREATE CONVERSION/DROP CONVERSION added |