initdb
initdb — создать кластер баз данных Postgres Pro Shardman
Синтаксис
initdb [параметр...] [ --pgdata | -D ]каталог
Описание #
Команда initdb создаёт новый кластер баз данных Postgres Pro Shardman.
Создание кластера баз данных заключается в создании каталогов для хранения данных кластера, формировании общих системных таблиц (относящихся ко всему кластеру, а не к какой-либо базе) и создании баз данных postgres, template1 и template0. База postgres используется пользователями, утилитами и сторонними приложениями по умолчанию. Базы template1 и template0 предназначены для использования в качестве исходных баз данных, копии которых будут создавать последующие команды CREATE DATABASE. Базу template0 не следует изменять никогда, но вы можете добавлять объекты в template1, и они по умолчанию будут копироваться в базы данных, создаваемые позже. За подробностями обратитесь к Разделу 21.4.
При попытке создать каталог для хранения данных initdb может столкнуться с нехваткой прав доступа, если этот каталог принадлежит суперпользователю root. В таком случае необходимо назначить пользователя базы данных владельцем этого каталога при помощи chown. Затем выполнить su для смены пользователя и дальнейшего выполнения initdb.
Команда initdb должна выполняться от имени пользователя, под которым будет запускаться сервер, так как ему необходим полный доступ к файлам и каталогам, создаваемым initdb. Сервер не может запускаться от имени суперпользователя, поэтому выполнение команды initdb от его лица будет отклонено.
Из соображений безопасности новый кластер, созданный программой initdb, будет доступен только для владельца кластера. Ключ --allow-group-access позволяет разрешить чтение файлов в кластере всем пользователям, входящим в группу владельца кластера. Это полезно для выполнения резервного копирования от имени непривилегированного пользователя.
initdb инициализирует локали и кодировки баз данных кластера, которые будут использоваться по умолчанию. Они могут устанавливаться раздельно при создании новой базы данных. initdb определяет параметры локали для шаблонных баз данных, применяющиеся по умолчанию для новых баз.
По умолчанию initdb получает параметры локали из переменных среды и определяет кодировку, исходя из параметров локали. Если провайдер локалей не задан, он выбирается автоматически на основании значения lc_collate для кластера: для локалей C и POSIX выбирается libc, а для других локалей — icu.
Выбрать другую локаль для кластера позволяет параметр --locale. Существуют также отдельные параметры --lc-* и --icu-locale (см. ниже), позволяющие задать значения для отдельных категорий локали. Учтите, что с неподходящими значениями для разных категорий локали результаты могут быть бессмысленными, поэтому эти значения следует выбирать продуманно.
В качестве библиотеки, реализующей поддержку локалей, initdb может также использовать библиотеку ICU, если указать --locale-provider=icu. При этом сервер должен быть собран с поддержкой ICU. Выбрать определённую локаль ICU позволяет параметр --icu-locale. Заметьте, что даже когда используется провайдер локалей ICU, initdb в любом случае выбирает и инициализирует локали libc в связи с особенностями реализации и для поддержки старого кода.
Когда команда initdb выполняется, она показывает, какие параметры локали выбраны. Если вы задавали комбинацию параметров или у вас есть особые требования, рекомендуется проверить, соответствует ли результат ожиданиям.
Подробнее о параметрах локали можно узнать в Разделе 22.1.
Для изменения кодировки по умолчанию используется параметр --encoding. Узнать об этом больше можно в Разделе 22.3.
Параметры
-Aauthmethod--auth=#authmethodПараметр определяет метод аутентификации по умолчанию для локальных пользователей, используемый в файле
pg_hba.conf(строкиhostиlocal). Допустимые значения описаны в Разделе 19.1.Программа
initdbпредварительно внесёт указанный метод аутентификации вpg_hba.confв записи как обычных соединений, так и соединений репликации.Не используйте
trust, если не можете доверять всем локальным пользователям в вашей системе. Режимtrustиспользуется по умолчанию для облегчения процесса установки.--auth-host=#authmethodПараметр указывает метод аутентификации для локальных пользователей, подключающихся по TCP/IP, используемый в
pg_hba.conf(строкиhost).--auth-local=#authmethodПараметр выбирает метод аутентификации локальных пользователей, подключающихся через Unix-сокет, используемый в
pg_hba.conf(строкиlocal).-Dкаталог--pgdata=#каталогПараметр указывает каталог хранения данных кластера. Это единственный обязательный параметр для команды
initdb. При этом его можно указать в переменной окруженияPGDATA, что будет удобным при дальнейшем использовании (postgresобращается к этой же переменной).-Eкодировка--encoding=#кодировкаУстанавливает кодировку по умолчанию для баз-шаблонов. Эта кодировка будет по умолчанию выбираться и для баз данных, создаваемых позже, если вы не переопределите её. Наборы символов, поддерживаемые сервером Postgres Pro Shardman, описаны в Подразделе 22.3.1.
По умолчанию кодировка для баз-шаблонов выбирается, исходя из указанной локали. Если задан параметр
--no-locale(или, что равнозначно, задана локальCилиPOSIX), по умолчанию используетсяUTF8для провайдера ICU иSQL_ASCIIдля провайдераlibc.-g--allow-group-access#Позволяет пользователям, входящим в группу владельца кластера, читать все файлы кластера, создаваемые программой
initdb.--icu-locale=#локальУказывает локаль ICU, если используется провайдер локалей ICU. Поддержка локали описана в Разделе 22.1. По умолчанию используется значение
--locale, если оно указано, в противном случае — значение lc_collate.--icu-rules=#правилаУказывает дополнительные правила для настройки поведения сортировки по умолчанию. Параметр поддерживается только для ICU.
-k--data-checksums#Применять контрольные суммы на страницах данных для выявления сбоев при вводе-выводе, которые иначе останутся незамеченными. Этот режим включён по умолчанию; используйте
--no-data-checksums, чтобы отключить расчёт контрольных сумм.Расчёт контрольных сумм может повлечь незначительное снижение производительности. Когда контрольные суммы включены, они рассчитываются для всех объектов и во всех базах данных. Все ошибки контрольных сумм будут видны в представлении
pg_stat_database. За подробностями обратитесь к Разделу 28.2.По умолчанию кластеры Postgres Pro Shardman инициализируются с включёнными контрольными суммами. Чтобы изменить это поведение, добавьте параметр
--no-data-checksums.--locale=#локальУстанавливает локаль кластера по умолчанию. Если флаг не указан, локаль устанавливается согласно окружению, в котором исполняется команда
initdb. Поддерживаемые локали описаны в Разделе 22.1.Если для параметра
--locale-providerустановлено значениеbuiltin, то также должен быть задан--localeили--builtin-localeсо значениемC,C.UTF-8илиPG_UNICODE_FAST.--lc-collate=локаль--lc-ctype=локаль--lc-messages=локаль--lc-monetary=локаль--lc-numeric=локаль--lc-time=#локальАналогично
--localeустанавливает локаль, но только для заданной категории. Параметр--lc-collateпереопределяет параметр--localeнезависимо от того, указан ли провайдер правил сортировки.--no-locale#Аналогично флагу
--locale=C.--builtin-locale=#локальУказывает имя локали при использовании провайдера
builtin. Поддержка локалей описана в Разделе 22.1.--locale-provider={#builtin|libc|icu}Этот параметр выбирает провайдера локалей для баз данных, создаваемых в новом кластере. Его можно переопределить для создаваемых впоследствии баз в команде
CREATE DATABASE. См. Подраздел 22.1.4.--no-data-checksums#Не включать расчёт контрольных сумм данных.
--pwfile=#имя_файлаПринуждает
initdbчитать пароль начального суперпользователя из файла, первая строка которого используется в качестве пароля.--no-tune#По умолчанию использование утилиты pgpro_tune в
initdbвключено. Чтобы её отключить, используйте этот параметр.--tune=#параметрыУстанавливает параметры для pgpro_tune. За дополнительной информацией обратитесь к их описанию.
-Tконфигурация--text-search-config=#конфигурацияУстанавливает конфигурацию текстового поиска по умолчанию. За дополнительными сведениями обратитесь к default_text_search_config.
-Uимя_пользователя--username=#имя_пользователяЗадаёт имя пользователя для начального суперпользователя. По умолчанию это имя пользователя ОС, запускающего
initdb.-W--pwprompt#Указывает
initdbзапросить пароль, который будет назначен начальному суперпользователю. Это не важно, если не планируется использовать аутентификацию по паролю. В ином случае этот режим аутентификации оказывается неприменимым, пока пароль не задан.-Xкаталог--waldir=#каталогЭтот параметр указывает каталог для хранения журнала предзаписи.
--wal-segsize=#размерЗадаёт размер сегмента WAL, в мегабайтах. Такой размер будет иметь каждый отдельный файл в журнале WAL. По умолчанию размер равен 16 мегабайтам. Значение должно задаваться степенью 2 от 1 до 1024 (в мегабайтах). Этот параметр можно установить только во время инициализации и нельзя изменить позже.
Этот размер бывает полезно поменять при тонкой настройке трансляции или архивации WAL. Кроме того, в базах данных с WAL большого объёма огромное количество файлов WAL в каталоге может стать проблемой с точки зрения производительности и администрирования. Увеличение размера файлов WAL приводит к уменьшению числа этих файлов.
Другие реже используемые параметры описаны здесь:
-cимя=значение--set#имя=значениеПринудительно устанавливает заданное
значениедля серверного параметра с указаннымименемво времяinitdb, а также переопределяет этот параметр в файлеpostgresql.conf, чтобы использовать его при последующих запусках сервера. Этот параметрinitdbможно задавать несколько раз, чтобы переопределить несколько серверных параметров. В основном он используется в случаях, когда сервер не может запуститься со значениями параметров по умолчанию.-d--debug#Выводит отладочные сообщения загрузчика и ряд других сообщений, не очень интересных широкой публике. Загрузчик — это приложение
initdb, используемое для создания каталога таблиц. С этим параметром выдаётся очень много крайне скучных сообщений.--discard-caches#Запустить загрузчик с параметром
debug_discard_caches=1. Это очень сильно замедлит выполнение и полезно только для низкоуровневой отладки.-L#каталогУказывает
initdb, где необходимо искать входные файлы для развёртывания кластера. Обычно это не требуется. Приложение само запросит эти данные, если будет необходимо.-n--no-clean#По умолчанию, при выявлении ошибки на этапе развёртывания кластера,
initdbудаляет все файлы, которые к тому моменту были созданы. Параметр предотвращает очистку файлов для целей отладки.-N--no-sync#По умолчанию
initdbждёт, пока все файлы не будут надёжно записаны на диск. С данным параметромinitdbзавершается быстрее, без ожидания, но в случае неожиданного сбоя операционной системы каталог данных может оказаться испорченным. Этот параметр может быть полезен при тестировании; в производственной среде применять его не следует.--no-sync-data-files#По умолчанию
initdbбезопасно записывает все файлы базы данных на диск. С этим параметромinitdbпропускает синхронизацию всех файлов в каталогах отдельных баз данных, самих каталогов баз данных, а также каталогов табличных пространств, то есть всего содержимого подкаталогаbaseи любых других каталогов табличных пространств. Другие файлы, такие как файлы вpg_walиpg_xact, будут синхронизированы, если только не указан параметр--no-sync.Заметьте, что если параметр
--no-sync-data-filesиспользуется в сочетании с--sync-method=syncfs, некоторые или все вышеупомянутые файлы и каталоги будут синхронизированы, потому чтоsyncfsобрабатывает файловые системы целиком.Этот параметр в основном предназначен для внутреннего использования инструментами, которые самостоятельно обеспечивают синхронизацию пропущенных файлов с диском.
--no-instructions#По умолчанию
initdbпосле всех сообщений выводит инструкции по запуску кластера. С этим ключом данные инструкции выводиться не будут. Этот ключ предназначен в первую очередь для применения на платформах, гдеinitdbиспользуется в специальных высокоуровневых процедурах, в рамках которых данные инструкции оказываются некорректными.-s--show#Вывести внутренние параметры и завершить команду. Может использоваться для отладки во время установки initdb.
--sync-method=#методСо значением
fsync(это значение по умолчанию),initdbбудет рекурсивно открывать и синхронизировать все файлы в каталоге данных. Поиск файлов будет осуществляться по символическим ссылкам для каталога WAL и каждого настроенного табличного пространства.В Linux возможен вариант
syncfs, когда от ОС требуется синхронизировать целиком каждую из файловых систем, содержащих каталог данных, файлы WAL и табличные пространства. Более подробно особенности использованияsyncfsописаны в recovery_init_sync_method.В режиме
--no-syncэтот параметр не оказывает никакого влияния.-S--sync-only#Безопасно записывает все файлы базы на диск и останавливается. Другие операции initdb при этом не выполняются. В целом, этот параметр полезен для обеспечения надёжного восстановления после изменения значения fsync с
offнаon.
Другие параметры для тестирования 64-битных идентификаторов транзакций:
-mSTART_MX_ID--multixact-id=START_MX_IDЗадаёт для нового экземпляра БД начальный идентификатор мультитранзакций в десятичном виде для тестирования обновлений БД, значение по умолчанию —
0.-oSTART_MX_OFFSET--multixact-offset=START_MX_OFFSETЗадаёт для нового экземпляра БД начальное смещение мультитранзакций в десятичном виде для тестирования обновлений БД, значение по умолчанию —
0.-xSTART_XID--xid=START_XIDЗадаёт для нового экземпляра БД начальный идентификатор транзакций в десятичном виде для тестирования обновлений БД, значение по умолчанию —
0.
Прочие параметры:
Переменные окружения
PGDATA#Указывает каталог хранения данных кластера, можно изменить параметром
-D.PG_COLOR#Выбирает вариант использования цвета в диагностических сообщениях. Возможные значения:
always(всегда),auto(автоматически) иnever(никогда).PGPRO_TUNE#Указывает, нужно ли использовать утилиту pgpro_tune без изменения параметров в командной строке. Возможные значения:
enable/disable,true/false,on/offиyes/no. Если установлено значениеdisable,false,offилиno, действие этой переменной окружения аналогично установлению параметра--no-tune, то есть отключает pgpro_tune. Если задано другое значение и параметр--tuneили--no-tuneв командной строке явным образом не указан, поведение будет таким же, как если бы для параметра--tuneбыло задано значениеPGPRO_TUNE.TZ#Указывает часовой пояс кластера по умолчанию. Значение — это полное имя часового пояса (см. Подраздел 8.5.3).
Примечания
initdb можно выполнить командой pg_ctl initdb.
См. также
pg_ctl, postgres, Раздел 19.1initdb
initdb — create a new Postgres Pro Shardman database cluster
Synopsis
initdb [option...] [ --pgdata | -D ] directory
Description #
initdb creates a new Postgres Pro Shardman database cluster.
Creating a database cluster consists of creating the directories in which the cluster data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the postgres, template1, and template0 databases. The postgres database is a default database meant for use by users, utilities and third party applications. template1 and template0 are meant as source databases to be copied by later CREATE DATABASE commands. template0 should never be modified, but you can add objects to template1, which by default will be copied into databases created later. See Section 21.4 for more details.
Although initdb will attempt to create the specified data directory, it might not have permission if the parent directory of the desired data directory is root-owned. 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.
initdb must be run as the user that will own the server process, because the server needs to have access to the files and directories that initdb creates. Since the server cannot be run as root, you must not run initdb as root either. (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.
initdb initializes the database cluster's default locale and character set encoding. These can also be set separately for each database when it is created. initdb determines those settings for the template databases, which will serve as the default for all other databases.
By default, initdb takes the locale settings from the environment, and determines the encoding from the locale settings. If the locale provider is not specified, it is set automatically based on the lc_collate value for the cluster: libc is used for the C or POSIX locales, and icu is used for other locales.
To choose a different locale for the cluster, use the option --locale. There are also individual options --lc-* and --icu-locale (see below) to set values for the individual locale categories. Note that inconsistent settings for different locale categories can give nonsensical results, so this should be used with care.
Alternatively, initdb can use the ICU library to provide locale services by specifying --locale-provider=icu. The server must be built with ICU support. To choose the specific ICU locale ID to apply, use the option --icu-locale. Note that for implementation reasons and to support legacy code, initdb will still select and initialize libc locale settings when the ICU locale provider is used.
When initdb runs, it will print out the locale settings it has chosen. If you have complex requirements or specified multiple options, it is advisable to check that the result matches what was intended.
More details about locale settings can be found in Section 22.1.
To alter the default encoding, use the --encoding. More details can be found in Section 22.3.
Options
-Aauthmethod--auth=#authmethodThis option specifies the default authentication method for local users used in
pg_hba.conf(hostandlocallines). See Section 19.1 for an overview of valid values.initdbwill prepopulatepg_hba.confentries using the specified authentication method for non-replication as well as replication connections.Do not use
trustunless you trust all local users on your system.trustis the default for ease of installation.--auth-host=#authmethodThis option specifies the authentication method for local users via TCP/IP connections used in
pg_hba.conf(hostlines).--auth-local=#authmethodThis option specifies the authentication method for local users via Unix-domain socket connections used in
pg_hba.conf(locallines).-Ddirectory--pgdata=#directoryThis option specifies the directory where the database cluster should be stored. This is the only information required by
initdb, but you can avoid writing it by setting thePGDATAenvironment variable, which can be convenient since the database server (postgres) can find the data directory later by the same variable.-Eencoding--encoding=#encodingSelects the encoding of the template databases. This will also be the default encoding of any database you create later, unless you override it then. The character sets supported by the Postgres Pro Shardman server are described in Section 22.3.1.
By default, the template database encoding is derived from the locale. If
--no-localeis specified (or equivalently, if the locale isCorPOSIX), then the default isUTF8for the ICU provider andSQL_ASCIIfor thelibcprovider.-g--allow-group-access#Allows users in the same group as the cluster owner to read all cluster files created by
initdb.--icu-locale=#localeSpecifies the ICU locale when the ICU provider is used. Locale support is described in Section 22.1. The default is the setting of
--localeif specified and otherwise the value of lc_collate.--icu-rules=#rulesSpecifies additional collation rules to customize the behavior of the default collation. This is supported for ICU only.
-k--data-checksums#Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. This is enabled by default; use
--no-data-checksumsto disable checksums.Enabling checksums might incur a small performance penalty. If set, checksums are calculated for all objects, in all databases. All checksum failures will be reported in the
pg_stat_databaseview. See Section 28.2 for details.By default, Postgres Pro Shardman clusters are initialized with checksums enabled. To change this behavior, provide the
--no-data-checksumsoption.--locale=#localeSets the default locale for the database cluster. If this option is not specified, the locale is inherited from the environment that
initdbruns in. Locale support is described in Section 22.1.If
--locale-providerisbuiltin,--localeor--builtin-localemust be specified and set toC,C.UTF-8orPG_UNICODE_FAST.--lc-collate=locale--lc-ctype=locale--lc-messages=locale--lc-monetary=locale--lc-numeric=locale--lc-time=#localeLike
--locale, but only sets the locale in the specified category. The--lc-collateoption overrides the--localesetting, regardless of whether the collation provider is specified.--no-locale#Equivalent to
--locale=C.--builtin-locale=#localeSpecifies the locale name when the builtin provider is used. Locale support is described in Section 22.1.
--locale-provider={#builtin|libc|icu}This option sets the locale provider for databases created in the new cluster. It can be overridden in the
CREATE DATABASEcommand when new databases are subsequently created. See Section 22.1.4.--no-data-checksums#Do not enable data checksums.
--pwfile=#filenameMakes
initdbread the bootstrap superuser's password from a file. The first line of the file is taken as the password.--no-tune#By default, the use of pgpro_tune is enabled in
initdb. Use this option to disable it.--tune=#optionsSets parameters for pgpro_tune. See their description for further information.
-Tconfig--text-search-config=#configSets the default text search configuration. See default_text_search_config for further information.
-Uusername--username=#usernameSets the user name of the bootstrap superuser. This defaults to the name of the operating-system user running
initdb.-W--pwprompt#Makes
initdbprompt for a password to give the bootstrap 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.-Xdirectory--waldir=#directoryThis option specifies the directory where the write-ahead log should be stored.
--wal-segsize=#sizeSet the WAL segment size, in megabytes. This is the size of each individual file in the WAL log. The default size is 16 megabytes. The value must be a power of 2 between 1 and 1024 (megabytes). This option can only be set during initialization, and cannot be changed later.
It may be useful to adjust this size to control the granularity of WAL log shipping or archiving. Also, in databases with a high volume of WAL, the sheer number of WAL files per directory can become a performance and management problem. Increasing the WAL file size will reduce the number of WAL files.
Other, less commonly used, options are also available:
-cname=value--set#name=valueForcibly set the server parameter
nametovalueduringinitdb, and also install that setting in the generatedpostgresql.conffile, so that it will apply during future server runs. This option can be given more than once to set several parameters. It is primarily useful when the environment is such that the server will not start at all using the default parameters.-d--debug#Print debugging output from the bootstrap backend and a few other messages of lesser interest for the general public. The bootstrap backend is the program
initdbuses to create the catalog tables. This option generates a tremendous amount of extremely boring output.--discard-caches#Run the bootstrap backend with the
debug_discard_caches=1option. This takes a very long time and is only of use for deep debugging.-L#directorySpecifies where
initdbshould find its input files to initialize the database cluster. This is normally not necessary. You will be told if you need to specify their location explicitly.-n--no-clean#By default, when
initdbdetermines that an error prevented it from completely creating the database cluster, it removes any files it might have created before discovering that it cannot finish the job. This option inhibits tidying-up and is thus useful for debugging.-N--no-sync#By default,
initdbwill wait for all files to be written safely to disk. This option causesinitdbto return without waiting, which is faster, but means that a subsequent operating system crash can leave the data directory corrupt. Generally, this option is useful for testing, but should not be used when creating a production installation.--no-sync-data-files#By default,
initdbsafely writes all database files to disk. This option instructsinitdbto skip synchronizing all files in the individual database directories, the database directories themselves, and the tablespace directories, i.e., everything in thebasesubdirectory and any other tablespace directories. Other files, such as those inpg_walandpg_xact, will still be synchronized unless the--no-syncoption is also specified.Note that if
--no-sync-data-filesis used in conjunction with--sync-method=syncfs, some or all of the aforementioned files and directories will be synchronized becausesyncfsprocesses entire file systems.This option is primarily intended for internal use by tools that separately ensure the skipped files are synchronized to disk.
--no-instructions#By default,
initdbwill write instructions for how to start the cluster at the end of its output. This option causes those instructions to be left out. This is primarily intended for use by tools that wrapinitdbin platform-specific behavior, where those instructions are likely to be incorrect.-s--show#Show internal settings and exit, without doing anything else. This can be used to debug the initdb installation.
--sync-method=#methodWhen set to
fsync, which is the default,initdbwill recursively open and synchronize all files in the data directory. The search for files will follow symbolic links for the WAL directory and each configured tablespace.On Linux,
syncfsmay be used instead to ask the operating system to synchronize the whole file systems that contain the data directory, the WAL files, and each tablespace. See recovery_init_sync_method for information about the caveats to be aware of when usingsyncfs.This option has no effect when
--no-syncis used.-S--sync-only#Safely write all database files to disk and exit. This does not perform any of the normal initdb operations. Generally, this option is useful for ensuring reliable recovery after changing fsync from
offtoon.
Other options for testing 64-bit XIDs:
-mSTART_MX_ID--multixact-id=START_MX_IDSpecifies the initial multixact ID value in the decimal format for a new database instance to test database upgrades, default value is
0.-oSTART_MX_OFFSET--multixact-offset=START_MX_OFFSETSpecifies the initial multixact offset value in the decimal format for a new database instance to test database upgrades, default value is
0.-xSTART_XID--xid=START_XIDSpecifies the initial XID value in the decimal format for a new database instance to test database upgrades, default value is
0.
Other options:
Environment
PGDATA#Specifies the directory where the database cluster is to be stored; can be overridden using the
-Doption.PG_COLOR#Specifies whether to use color in diagnostic messages. Possible values are
always,autoandnever.PGPRO_TUNE#Specifies whether to use pgpro_tune without modifying command-line options directly. Possible values are
enable/disable,true/false,on/off, andyes/no. If set todisable,false,off, orno, this environment variable has the same effect as passing--no-tune, disabling the use of pgpro_tune. If set to any other value, and neither--tunenor--no-tuneis explicitly specified on the command line, the behavior is the same as if--tuneis specified with the value ofPGPRO_TUNE.TZ#Specifies the default time zone of the created database cluster. The value should be a full time zone name (see Section 8.5.3).
Notes
initdb can also be invoked via pg_ctl initdb.