I have added SQL99's CONVERT() function. docs and regression tests
also updated. Our own convert() functions can also be used. Example
usage of CONVERT():

convert('PostgreSQL' using iso8859_1_to_utf8)

will return 'PostgreSQL' in UTF-8 encoding. See "String Functions and
Operators" section of Users's guide for more details and currently
available (predefined) conversions.

I believe remaining work for CONVERSION stuffs is some conversions for
cyrillic and win874/1250/1251/1256 encodings.
--
Tatsuo Ishii

Tue, 06 Aug 2002 14:55:04 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
SQL99 CONVERT() function
> I believe remaining work for CONVERSION stuffs is some conversions for
> cyrillic and win874/1250/1251/1256 encodings.

Oops. I forgot the cygwin (and AIX) issue. Need to address it before
beta freeze...
--
Tatsuo Ishii

Tue, 06 Aug 2002 15:57:35 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: SQL99 CONVERT() function
On Tue, Aug 06, 2002 at 02:55:04PM +0900, Tatsuo Ishii wrote:
> I have added SQL99's CONVERT() function. docs and regression tests
> also updated. Our own convert() functions can also be used. Example
> usage of CONVERT():
> 
> convert('PostgreSQL' using iso8859_1_to_utf8)
                                      ^^^^^
 What is it? Is it really in standard? Sorry, but it seems
 strange. What 'ISO8859-1' as name?

 CAST( int_as_char ) ? :-)

 .... CONVERT('PostgreSQL' USING 'ISO8859-1' TO 'UTF8')

       Karel

-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Tue, 6 Aug 2002 09:54:17 +0200
Karel Zak <zakkr@zf.jcu.cz>
Re: SQL99 CONVERT() function
> On Tue, Aug 06, 2002 at 02:55:04PM +0900, Tatsuo Ishii wrote:
> > I have added SQL99's CONVERT() function. docs and regression tests
> > also updated. Our own convert() functions can also be used. Example
> > usage of CONVERT():
> > 
> > convert('PostgreSQL' using iso8859_1_to_utf8)
>                                       ^^^^^
>  What is it? Is it really in standard?

It's a "conversion name".

>From SQL99:
              CONVERT <left paren> <character value expression>
                  USING <form-of-use conversion name> <right paren>

> Sorry, but it seems
>  strange. What 'ISO8859-1' as name?

Sure, you can use '-' instead of '_' if you don't mind quoting it
with "(i.e. delimited identifier).

convert('PostgreSQL' using "iso8859-1-to-utf8")

I'm sure people don't like that way...
--
Tatsuo Ishii

Tue, 06 Aug 2002 17:19:50 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: SQL99 CONVERT() function
On Tue, Aug 06, 2002 at 05:19:50PM +0900, Tatsuo Ishii wrote:
> > On Tue, Aug 06, 2002 at 02:55:04PM +0900, Tatsuo Ishii wrote:
> > > I have added SQL99's CONVERT() function. docs and regression tests
> > > also updated. Our own convert() functions can also be used. Example
> > > usage of CONVERT():
> > > 
> > > convert('PostgreSQL' using iso8859_1_to_utf8)
> >                                       ^^^^^
> >  What is it? Is it really in standard?
> 
> It's a "conversion name".
> 
> >From SQL99:
>               CONVERT <left paren> <character value expression>
>                   USING <form-of-use conversion name> <right paren>

 Ah.. conversion name. I was thinking it are names of encodings. 
 It's right.
 
    Karel
    
-- 
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/
 
 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

Tue, 6 Aug 2002 10:49:59 +0200
Karel Zak <zakkr@zf.jcu.cz>
Re: SQL99 CONVERT() function
Tatsuo Ishii writes:

> > Sorry, but it seems
> >  strange. What 'ISO8859-1' as name?
>
> Sure, you can use '-' instead of '_' if you don't mind quoting it
> with "(i.e. delimited identifier).
>
> convert('PostgreSQL' using "iso8859-1-to-utf8")
>
> I'm sure people don't like that way...

I suggest using the official IANA names and replace all the non-identifier
characters by underscores and all upper-case letters with lower-case.
So it would be iso_8859_1_to_utf_8.  That way it's almost as pretty but a
lot more predictable.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 6 Aug 2002 23:18:18 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: SQL99 CONVERT() function
> I suggest using the official IANA names and replace all the non-identifier
> characters by underscores and all upper-case letters with lower-case.
> So it would be iso_8859_1_to_utf_8.  That way it's almost as pretty but a
> lot more predictable.

Sounds reasonable. I'll look into this. However I have to examin each
encodings carefully. Because:

(1) some encodings are not listed IANA (e.g. TCVN, WIN874...)

(2) some offcial IANA names seem not appropriate
    (e.g. Extended_UNIX_Code_Packed_Format_for_Japanese)
:
:
--
Tatsuo Ishii

Wed, 07 Aug 2002 21:56:08 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: SQL99 CONVERT() function
Hello,

The attached patch adds CONVERSION stuff for cyrillic and
win874/1250/1251/1256 encodings.

Thank you.

From: Tatsuo Ishii <t-ishii@sra.co.jp>
Subject: [HACKERS] SQL99 CONVERT() function
Date: Tue, 06 Aug 2002 14:55:04 +0900 (JST)
Message-ID: <20020806.145504.35027319.t-ishii@sra.co.jp>

> I have added SQL99's CONVERT() function. docs and regression tests
> also updated. Our own convert() functions can also be used. Example
> usage of CONVERT():
> 
> convert('PostgreSQL' using iso8859_1_to_utf8)
> 
> will return 'PostgreSQL' in UTF-8 encoding. See "String Functions and
> Operators" section of Users's guide for more details and currently
> available (predefined) conversions.
> 
> I believe remaining work for CONVERSION stuffs is some conversions for
> cyrillic and win874/1250/1251/1256 encodings.
> --
> Tatsuo Ishii

-------------------
   Kaori Inaba  
 i-kaori@sra.co.jp
Tue, 13 Aug 2002 16:00:58 +0900 (JST)
Kaori Inaba <i-kaori@sra.co.jp>
Re: [HACKERS] SQL99 CONVERT() function
> The attached patch adds CONVERSION stuff for cyrillic and
> win874/1250/1251/1256 encodings.

Thanks. I'll take care of this.
--
Tatsuo Ishii

Tue, 13 Aug 2002 16:06:05 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: [HACKERS] SQL99 CONVERT() function
> > The attached patch adds CONVERSION stuff for cyrillic and
> > win874/1250/1251/1256 encodings.
> 
> Thanks. I'll take care of this.

Done. Documents and regression tests have been updated also. I think
now we have implemented all encoding conversions for 7.3 release.
--
Tatsuo Ishii

Wed, 14 Aug 2002 11:52:24 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: [HACKERS] SQL99 CONVERT() function
> > I suggest using the official IANA names and replace all the non-identifier
> > characters by underscores and all upper-case letters with lower-case.
> > So it would be iso_8859_1_to_utf_8.  That way it's almost as pretty but a
> > lot more predictable.
> 
> Sounds reasonable. I'll look into this. However I have to examin each
> encodings carefully. Because:
> 
> (1) some encodings are not listed IANA (e.g. TCVN, WIN874...)
> 
> (2) some offcial IANA names seem not appropriate
>     (e.g. Extended_UNIX_Code_Packed_Format_for_Japanese)
> :
> :

Done. See current doc (user's guide "6.4. String Functions and
Operators" Table 6-7 "Available conversion names") how I changed the
conversion names.
--
Tatsuo Ishii

Wed, 14 Aug 2002 14:31:12 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: SQL99 CONVERT() function
Tatsuo Ishii writes:

> Done. See current doc (user's guide "6.4. String Functions and
> Operators" Table 6-7 "Available conversion names") how I changed the
> conversion names.

What guideline did you follow?  For example, should koi8r be koi8_r?  Or
should winXXX be win_XXX?

-- 
Peter Eisentraut   peter_e@gmx.net



Tue, 20 Aug 2002 23:22:45 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: SQL99 CONVERT() function