Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How is the character set set set in initdb?


Asked by Vivienne Douglas on Dec 11, 2021 FAQ



The character set encoding, collation order (LC_COLLATE) and character set classes (LC_CTYPE, e.g., upper, lower, digit) can be set separately for a database when it is created. initdb determines those settings for the template1 database, which will serve as the default for all other databases.
Consequently,
(It will in fact refuse to do so.) For security reasons the new cluster created by initdb will only be accessible by the cluster owner by default. The --allow-group-access option allows any user in the same group as the cluster owner to read files in the cluster. This is useful for performing backups as a non-privileged user.
Also Know, The --allow-group-access option allows any user in the same group as the cluster owner to read files in the cluster. This is useful for performing backups as a non-privileged user. initdb initializes the database cluster's default locale and character set encoding.
And,
To initialize in such a setup, create an empty data directory as root, then use chown to assign ownership of that directory to the database user account, then su to become the database user to run initdb .
Thereof,
Makes initdb prompt for a password to give the database superuser. If you don't plan on using password authentication, this is not important. Otherwise you won't be able to use password authentication until you have a password set up. This option specifies the directory where the write-ahead log should be stored.