Обсуждение: Installing Postgresql on Debian (-E parameter question)

Поиск
Список
Период
Сортировка

Installing Postgresql on Debian (-E parameter question)

От
Panos Katergiathis
Дата:
Hello

In the past (a few years ago) i was always compiling Postgresql from
source. I remember that during the first initdb i was passing a -E
parameter to control the cluster's default encoding, which used to
influence search results and so on.

Now, i need to use Postgresql again, on Debian machines. I thought that
perhaps i can use standard Debian packages for installing Postgresql,
however i fail to understand some things:

a) Is it still essential to pass the -E proper parameter at the stage of
'initdb' in order to support various encodings fully?
b) If so, how does one pass this parameter when installing from a
standard *.deb package (or *.rpm, for that matter)?
c) If so (in reference to question (a)), is there any tutorial around
for installing Postgresql on Debian, that includes instructions for the
-E parameter?
d) Is there anything else that i should be aware of, relating to proper
character-set support in recent versions of Postgresql?

Please assist

Panos


Re: Installing Postgresql on Debian (-E parameter question)

От
Dimitri Fontaine
Дата:
Hi,

Le 9 juil. 09 à 20:57, Panos Katergiathis a écrit :
> a) Is it still essential to pass the -E proper parameter at the
> stage of
> 'initdb' in order to support various encodings fully?

Yes.

> b) If so, how does one pass this parameter when installing from a
> standard *.deb package (or *.rpm, for that matter)?

In debian case a default encoding and locale is defined at install
time from your environment. You can then rebuild a cluster with debian
wrapper tools:
   pg_lsclusters
   pg_dropcluster 8.4 main
   pg_createcluster -e 8.4 main

See man pages on your system, or even online:
   http://pwet.fr/man/linux/commandes/pg_lsclusters
   http://pwet.fr/man/linux/administration_systeme/pg_dropcluster
   http://pwet.fr/man/linux/administration_systeme/pg_createcluster

> c) If so (in reference to question (a)), is there any tutorial around
> for installing Postgresql on Debian, that includes instructions for
> the
> -E parameter?

See above, let the installer do its job then if you find it's not what
you wanted, you should fix your environment (which drives installer
decisions) or drop then create again the cluster.

> d) Is there anything else that i should be aware of, relating to
> proper
> character-set support in recent versions of Postgresql?

The cluster's encoding and locale have to be compatible with what you
want your database to have, in 8.4. In 8.3, only the encoding is to
consider as you couldn't change locale per database, it was per cluster.

Regards,
--
dim

Re: Installing Postgresql on Debian (-E parameter question)

От
Dimitri Fontaine
Дата:
Please keep the list in Copy.

Le 9 juil. 09 à 23:09, Panos Katergiathis a écrit :
> Thank you for all this information.
>
> Please allow me one more question.
> How can one detect the -E parameter that was used at the "initdb"
> stage?

That will match the encoding of template0, template1 and postgres
databases, by default.

> You see, there is an older machine that someone else has set-up, and
> i need to know the -E that he/she used before proceeding with a
> newer version of the software.

psql -l or \l will tell you!
--
dim