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-aborted transaction.  Using a pg_conversion OID in stored rules
isn't very acceptable either.

Unfortunately, I don't see any way offhand to fix this without an
initdb :-(.

			regards, tom lane

Fri, 01 Nov 2002 21:16:18 -0500
Tom Lane <tgl@sss.pgh.pa.us>
CONVERT function is seriously broken
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 where we are in an
> already-aborted transaction.  Using a pg_conversion OID in stored rules
> isn't very acceptable either.
> 
> 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?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Fri, 1 Nov 2002 23:10:14 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: CONVERT function is seriously broken
Bruce Momjian <pgman@candle.pha.pa.us> 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
                {
                    elog(ERROR, "CONVERT(... USING ...) is not implemented");
                }

Short of that, I think we need an initdb to change the function
signature for the convert() function.  It needs to take a (suitably
quoted) text parameter, not an OID.

Since we forced initdb only a week ago with beta3, I don't think there
is really a strong argument against doing it again.  But probably Marc
will say that we need a beta4 at this point, instead of going for RC1...

			regards, tom lane

Sat, 02 Nov 2002 00:00:17 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: CONVERT function is seriously broken 
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
> signature for the convert() function.  It needs to take a (suitably
> quoted) text parameter, not an OID.
> 
> Since we forced initdb only a week ago with beta3, I don't think there
> is really a strong argument against doing it again.  But probably Marc
> will say that we need a beta4 at this point, instead of going for RC1...

He certainly will.  We can shoot out beta4 and make it sort.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sat, 2 Nov 2002 00:38:27 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: CONVERT function is seriously broken
On Sat, 2 Nov 2002, Tom Lane wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> 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
>                 {
>                     elog(ERROR, "CONVERT(... USING ...) is not implemented");
>                 }
>
> Short of that, I think we need an initdb to change the function
> signature for the convert() function.  It needs to take a (suitably
> quoted) text parameter, not an OID.
>
> Since we forced initdb only a week ago with beta3, I don't think there
> is really a strong argument against doing it again.  But probably Marc
> will say that we need a beta4 at this point, instead of going for RC1...

Most definitely ... but beta3 was nice and short, and no reason why beta4
can't be as well ...



Sat, 2 Nov 2002 06:59:17 -0400 (AST)
"Marc G. Fournier" <scrappy@hub.org>
Re: CONVERT function is seriously broken 
> 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-aborted transaction.  Using a pg_conversion OID in stored rules
> isn't very acceptable either.
> 
> Unfortunately, I don't see any way offhand to fix this without an
> initdb :-(.

Sorry for the trouble and thanks for the fix.
--
Tatsuo Ishii

Sun, 03 Nov 2002 10:49:56 +0900 (JST)
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: CONVERT function is seriously broken