Re: [HACKERS] create database doesn't work well in MULTIBYTE mode

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] create database doesn't work well in MULTIBYTE mode
Дата
Msg-id 200002170540.AAA25566@candle.pha.pa.us
обсуждение исходный текст
Ответ на create database doesn't work well in MULTIBYTE mode  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Ответы RE: [HACKERS] create database doesn't work well in MULTIBYTE mode  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
> I have a crash while creating regression database in pararell regression
> test.
> Seems it's due to the following change.
> 
> @@ -2638,7 +2705,14 @@
>                      n->dbname = $3;
>                      n->dbpath = $5;
>  #ifdef MULTIBYTE
> -                    n->encoding = $6;
> +                    if ($6 != NULL) {
> +                        n->encoding = pg_char_to_encoding($6);
> +                        if (n->encoding < 0) {
> +                            elog(ERROR, "Encoding name '%s' is invalid", $6);
> +                        }
> +                    } else {
> +                        n->encoding = GetTemplateEncoding();
> +                    }
>  #else
>                      n->encoding = 0;
>  #endif
> 
> Why ?
> $6 is an ival not an str.

Not sure what to recommend here, but you clearly have found a problem. 
Try it as a string, and if that works, patch it.

--  Bruce Momjian                        |  http://www.op.net/~candle pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Chris Bitmead
Дата:
Сообщение: Re: [HACKERS] psql problem
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] Date/time types: big change