[HACKERS] convert function

2001-08-15 Thread Tatsuo Ishii
I have added new function called "convert" similar to SQL99's convert. Convert converts encoding according to parameters. For example, if you have a table named "unicode" in an Unicode database, SELECT convert(text_field, 'LATIN1') FROM unicode; will return text in ISO-8859-1 representation. Thi

Re: [HACKERS] convert function

2001-08-15 Thread Tatsuo Ishii
> I have added new function called "convert" similar to SQL99's convert. > Convert converts encoding according to parameters. For example, if you > have a table named "unicode" in an Unicode database, Forgot to mention that anyone who wants to try the new function should do initdb. I did not incr

Re: [HACKERS] convert function

2001-08-15 Thread Tom Lane
Tatsuo Ishii <[EMAIL PROTECTED]> writes: > I have added new function called "convert" similar to SQL99's convert. > Convert converts encoding according to parameters. For example, if you > have a table named "unicode" in an Unicode database, > SELECT convert(text_field, 'LATIN1') FROM unicode; >

Re: [HACKERS] convert function

2001-08-15 Thread Tatsuo Ishii
> Tatsuo Ishii <[EMAIL PROTECTED]> writes: > > I have added new function called "convert" similar to SQL99's convert. > > Convert converts encoding according to parameters. For example, if you > > have a table named "unicode" in an Unicode database, > > > SELECT convert(text_field, 'LATIN1') FROM

[HACKERS] CONVERT function is seriously broken

2002-11-01 Thread Tom Lane
I have just noticed that the implementation of CONVERT(text USING encoding_name) tries to do database access during the grammar phase, viz it looks up the encoding_name in pg_conversion and replaces it with an OID. This is not workable; consider the situation where we are in an already-abo

Re: [HACKERS] CONVERT function is seriously broken

2002-11-02 Thread Marc G. Fournier
On Sat, 2 Nov 2002, Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> Unfortunately, I don't see any way offhand to fix this without an > >> initdb :-(. > > > Ooch, that hurts. How bad would it be if it was broken in 7.3? > > We could dike out the feature: > > c

Re: [HACKERS] CONVERT function is seriously broken

2002-11-01 Thread Bruce Momjian
Tom Lane wrote: > I have just noticed that the implementation of > CONVERT(text USING encoding_name) > tries to do database access during the grammar phase, viz it looks > up the encoding_name in pg_conversion and replaces it with an OID. > > This is not workable; consider the situation wher

Re: [HACKERS] CONVERT function is seriously broken

2002-11-01 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Unfortunately, I don't see any way offhand to fix this without an >> initdb :-(. > Ooch, that hurts. How bad would it be if it was broken in 7.3? We could dike out the feature: convert_list: a_expr USING any_name

Re: [HACKERS] CONVERT function is seriously broken

2002-11-01 Thread Bruce Momjian
Tom Lane wrote: > We could dike out the feature: > > convert_list: > a_expr USING any_name > { > elog(ERROR, "CONVERT(... USING ...) is not implemented"); > } > > Short of that, I think we need an initdb to change the function > sign

Re: [HACKERS] CONVERT function is seriously broken

2002-11-02 Thread Tatsuo Ishii
> I have just noticed that the implementation of > CONVERT(text USING encoding_name) > tries to do database access during the grammar phase, viz it looks > up the encoding_name in pg_conversion and replaces it with an OID. > > This is not workable; consider the situation where we are in an >