INITDB(1) PostgreSQL 18.6 Documentation INITDB(1) (NAME) initdb - PostgreSQL (SYNOPSIS) initdb [...] [--pgdata | -D] (DESCRIPTION) initdb PostgreSQL . ( ) postgres template1 template0 . postgres . template1 template0 CREATE DATABASE . template0 template1 . 22.3 . initdb (root) . chown su initdb . initdb initdb . (root) initdb . ( .) initdb . --allow-group-access . . initdb (locale) (character set encoding) . . initdb (template) . initdb libc ( 23.1.4 ). libc . --locale . --lc-* --icu-locale ( ) . . initdb --locale-provider=icu ICU . ICU . ICU --icu-locale . initdb ICU libc . initdb . . 23.1 . --encoding . 23.3 ..SH " (OPTIONS)" -A authmethod --auth=authmethod pg_hba.conf ( host local) . Section 20.1 . initdb pg_hba.conf (replication) . trust . trust . --auth-host=authmethod TCP/IP pg_hba.conf ( host) . --auth-local=authmethod (Unix-domain socket) pg_hba.conf ( local) . -D directory --pgdata=directory . initdb PGDATA (postgres) . -E encoding --encoding=encoding . . PostgreSQL Section 23.3.1 . (locale) . --no-locale ( C POSIX ) ICU UTF8 libc SQL_ASCII . -g --allow-group-access initdb . Windows POSIX . --icu-locale=locale ICU ICU . Section 23.1 . --icu-rules=rules (collation rules) . ICU . -k --data-checksums I/O . --no-data-checksums . . . pg_stat_database . Section 28.2 . --locale=locale . initdb . Section 23.1 . --locale-provider builtin --locale --builtin-locale C C.UTF-8 PG_UNICODE_FAST . --lc-collate=locale --lc-ctype=locale --lc-messages=locale --lc-monetary=locale --lc-numeric=locale --lc-time=locale --locale . --no-locale --locale=C. --builtin-locale=locale builtin . Section 23.1 . --locale-provider={builtin|libc|icu} . CREATE DATABASE . libc ( Section 23.1.4 ). --no-data-checksums . --pwfile=filename initdb (bootstrap superuser) . . -T config --text-search-config=config . default_text_search_config . -U username --username=username (bootstrap superuser) . initdb . -W --pwprompt initdb (bootstrap superuser) . . . -X directory --waldir=directory (write-ahead log) . --wal-segsize=size (segment) WAL . WAL . . () . . (granularity) WAL . WAL WAL . WAL WAL . : -c name=value --set name=value name initdb value postgresql.conf . . . -d --debug bootstrap . bootstrap initdb . . --discard-caches bootstrap debug_discard_caches=1 . . -L directory initdb . . . -n --no-clean initdb . . -N --no-sync initdb . initdb (crash) (corrupt) . . --no-sync-data-files initdb . initdb tablespace base tablespace . pg_wal pg_xact --no-sync . --no-sync-data-files --sync-method=syncfs syncfs . . --no-instructions initdb . . initdb . -s --show . initdb . --sync-method=method fsync ( ) initdb . WAL tablespace . Linux syncfs WAL tablespace . syncfs recovery_init_sync_method . --no-sync . -S --sync-only . initdb . fsync off on . : -V --version initdb . -? --help initdb . PGDATA -D . PG_COLOR . always auto never. TZ . ( 8.5.3). (NOTES) initdb pg_ctl initdb . (SEE ALSO) pg_ctl(1) postgres(1) 20.1 PostgreSQL 18.6 2026 INITDB(1)