Re: db encoding

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: db encoding
Дата
Msg-id 2040.1065472284@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: db encoding  (Oliver Elphick <olly@lfix.co.uk>)
Ответы Re: db encoding  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-hackers
Oliver Elphick <olly@lfix.co.uk> writes:
> I currently use pg_encoding in Debian's automatic upgrade script to
> extract the existing default encoding from pg_database, thus:
> $ psql  -q -t -d template1 -c "select encoding from pg_database where
> datname = 'template1'"
>         0
> and then I use it to translate that number into an encoding name that
> can be fed to initdb.

But you can do that with pg_encoding_to_char:

regression=# select pg_encoding_to_char(encoding) from pg_database where datname = 'template1';pg_encoding_to_char
---------------------SQL_ASCII
(1 row)

AFAICS the standalone pg_encoding program is only useful if you need to
do encoding-number conversions while the postmaster is not available.
        regards, tom lane


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: CREATE USER bug
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: db encoding