blog20100901

2013/08/20 - プログラミング言語 Perl にまつわる etc. - Perl monger
参考 : perldoc, perldoc.jp, search.cpan.org, perldoc.perl.org ...
「 初めての Perl 第 6 版 」(オライリー・ジャパン発行 ISBN978-4-87311-567-2) 」
「 続・初めての Perl 改訂版 」(オライリー・ジャパン発行 ISBN4-87311-305-9) 」
「 Effective Perl 第 2 版 」(翔泳社発行 ISBN978-4-7981-3981-4) 」 ... etc,.

Perl_7 翻訳

翻訳 PostgreSQL13 man initdb (d221)

目次 - Perl Index


Theme



Perl について、復習を兼ねて断片的な情報を掲載して行く連載その d221 回。

今回は, リレーショナルデータベースマネージメントシステム (RDBMS) の定番 PostgresSQL13 でデータベースクラスタを作成するユーティリティ「 initdb 」の man ページを翻訳します。誤訳・誤解はご指摘ください。

翻訳完了後に公式日本語ドキュメント (バージョンは 9.2.4) の存在に気づきました。正確な内容は公式の「 PostgreSQL 9.2.4文書 initdb 」を確認するか man initdb を実行して確認してください。

なお, バージョン 9.2.4 のドキュメントには以下についての記述が見られませんでした。

  • --allow-group-access

  • --data-checksums

  • --no-sync

  • --sync-only

  • --waldir=directory

  • --wal-segsize=size

  • PG_COLOR

  • TZ



バージョン 13 の man initdb には以下についての記述が見られませんでした。

  • --xlogdir=directory :トランザクションログ格納ディレクトリの指定




INITDB(1) PostgreSQL 13.5 Documentation INITDB(1)



名前 :NAME



initdb - create a new PostgreSQL database cluster

initdb - 新しい PostgreSQL データベースクラスタを作成する


概要 :SYNOPSIS




initdb [option...] [--pgdata | -D] directory



説明 :DESCRIPTION



initdb creates a new PostgreSQL database cluster. A database cluster is a collection of databases that are managed by a single server instance.

initdb は新しい PostgreSQL データベースクラスタを作成します. データベースクラスはひとつのサーバインスタンスによって管理されるデータベースのコレクションです.

Creating a database cluster consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that belong to the whole cluster rather than to any particular database), and creating the template1 and postgres databases. When you later create a new database, everything in the template1 database is copied. (Therefore, anything installed in template1 is automatically copied into each database created later.) The postgres database is a default database meant for use by users, utilities and third party applications.

データベースクラスタの作成はそのデータベースが存在するディレクトリ, 共有カタログテーブル (何か特定のデータベースではなくクラスタ全体に属するテーブル) の生成, および template1 と postgres データベースの作成で構成されます. あなたが新しいデータベースを後で作成すると, template1 データベースのすべてがコピーされます. (したがって, template1 にインストールされたものはすべて自動的に後で作成された各データベースにコピーされます.) postgres データベースはユーザ, ユーティリティおよびサードパーティアプリケーションによって使われることを目的としたデフォルトデータベースです.

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 は指定されたデータディレクトリの作成を試みますが, 目的のデータディレクトリの親ディレクトリが root 所有の場合には権限をもっていないかもしれません. そのようなセットアップで初期化するためには, root として空のデータディレクトリを作成し, そのディレクトリの所有権をデータベースユーザアカウントにアサインするために chown を使い, initdb を実行するために su でデータベースユーザになります.

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.)

initdb はサーバプロセスを所有するユーザとして実行する必要があります, サーバは initdb が作成するファイルとディレクトリへのアクセスをする必要があるためです. サーバは root として実行することはできないので, あなたは initdb も root として実行してはいけません. (それは実際にそうすることを拒否します.)

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 によって作成された新しいクラスタはデフォルトでそのクラスタの所有者によってのみアクセス可能です. --allow-group-access オプションはクラスタ所有者と同じグループのすべてユーザにそのクラスタのファイルの読込みをできるようにします. これは非特権ユーザとしてバックアップを実行するのに便利です.

initdb initializes the database cluster's default locale and character set encoding. 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.

initdb はデータベースクラスタのデフォルトロケールとキャラクタセットのエンコーディングを初期化します. このキャラクタセットのエンコーディング, 照合順序 (LC_COLLATE) およびキャラクタセットクラス (LC_CTYPE, e.g, upper, lower, digit) はデータベースが作成されるときに別々にセットできます. initdb は template1 のためにそれらのセッティングを決定します, それは他のすべてのデータベースのデフォルトとしてサーブされます.

To alter the default collation order or character set classes, use the --lc-collate and --lc-ctype options. Collation orders other than C or POSIX also have a performance penalty. For these reasons it is important to choose the right locale when running initdb.

デフォルトの照合順序やキャラクタセットクラスを変更するには, --lc-collate と --lc-ctype オプションを使います. C あるいは POSIX 以外の照合順序はパフォーマンスペナルティをもちます. これらの理由から initdb を実行するときは正しいロケールを選択することが重要です.

The remaining locale categories can be changed later when the server is started. You can also use --locale to set the default for all locale categories, including collation order and character set classes. All server locale values (lc_*) can be displayed via SHOW ALL. More details can be found in Section 23.1.

残りのロケールカテゴリは後でサーバがスタートされるときに変更できます. あなたは照合順序とキャラクタセットクラスを含む, すべてのロケールカテゴリのデフォルトをセットするために --locale も使えます. すべてのサーバロケール値 (lc_*) は SHOW ALL を介して表示できます. セクション 23.1 で詳細を見つけられます.

To alter the default encoding, use the --encoding. More details can be found in Section 23.3.

デフォルトのエンコーディングを変更するには, --encoding を使います. セクション 23.3 で詳細を見つけられます.


オプション :OPTIONS




  • -A authmethod
    --auth=authmethod
    • This option specifies the default authentication method for local users used in pg_hba.conf (host and local lines). initdb will prepopulate pg_hba.conf entries using the specified authentication method for non-replication as well as replication connections.

      このオプションは pg_hba.conf (host と local 行) で使われる local ユーザのデフォルトの認証メソッドを指定します. initdb はレプリケーション接続と同じく指定された認証メソッドを使って pg_hba.conf エントリを事前投入します.
      Do not use trust unless you trust all local users on your system. trust is the default for ease of installation.

      あなたがあなたのシステム上のすべてのローカルユーザを信頼していない限り trust を使わないでください. trust は簡便にインストールにするためのデフォルトです.

  • --auth-host=authmethod
    • This option specifies the authentication method for local users via TCP/IP connections used in pg_hba.conf (host lines).

      このオプションは pg_hba.conf (host 行) で使われる TCP/IP 接続を介したローカルユーザのための認証メソッドを指定します.

  • --auth-local=authmethod
    • This option specifies the authentication method for local users via Unix-domain socket connections used in pg_hba.conf (local lines).

      このオプションは pg_hba.conf (local 行) で使われる Unix ドメインソケットを介したローカルユーザのための認証メソッドを指定します.

  • -D directory
    --pgdata=directory
    • This 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 the PGDATA environment variable, which can be convenient since the database server (postgres) can find the database directory later by the same variable.

      このオプションはデータベースクラスタが格納されるべきディレクトリを指定します. initdb が必要とするのはこの情報だけですが, あなたは PGDATA 環境変数をセッティングすることにでその記述を回避できて, それはデータベースサーバ (postgres) が後で同じ変数によってデータディレクトリを見つけることができるので便利です.

  • -E encoding
    --encoding=encoding
    • Selects the encoding of the template database. This will also be the default encoding of any database you create later, unless you override it there. The default is derived from the locale, or SQL_ASCII if that does not work. The character sets supported by the PostgreSQL server are described in Section 23.3.1.

      template データベースのエンコーディングを選択します. これはあなたがそれをオーバライドしない限り, あなたが後で作成するすべてのデータベースのデフォルトエンコーディングになります. デフォルトは locale から, あるいはそれが機能しない場合は SQL_ASCII から導かれます. PostgreSQL サーバによってサポートされるキャラクタセットはセクション 23.3.1 で説明されています.

  • -g
    --allow-group-access
    • Allows users in the same group as the cluster owner to read all cluster files created by initdb. This option is ignored on Windows as it does not support POSIX-style group permissions.

      クラスタ所有者と同じグループのユーザに initdb により作成されたすべてのクラスタファイルの読取りを可能にします. このオプションは POSIX スタイルのグループ権限をサポートしない Windows 上では無視されます.

  • -k
    --data-checksums
    • Use checksums on data pages to help detect corruption by the I/O system that would otherwise be silent. Enabling checksums may incur a noticeable performance penalty. If set, checksums are calculated for all objects, in all databases. All checksum failures will be reported in the pg_stat_database view.

      データページ上でチェックサムを使い他の場合では沈黙するであろう I/O システムによる破損の検知をヘルプします. チェックサムを有効にすると顕著なパフォーマンスペナルティをこうむります. もしセットすると, チェックサムはすべてのデータベースの, すべてのオブジェクトのために計算されます. すべてのチェックサムの失敗は pg_stat_database ビューでレポートされます.

  • --locale=locale
    • Sets the default locale for the database cluster. If this option is not specified, the locale is inherited from the environment that initdb runs in. Locale support is described in Section 23.1.

      データベースクラスタのデフォルトのロケールをセットします. このオプションが指定されない場合, ロケールは initdb が走る環境から継承されます. ロケールのサポートはセクション 23.1 で説明されています.

  • --lc-collate=locale
    --lc-ctype=locale
    --lc-messages=locale
    --lc-monetary=locale
    --lc-numeric=locale
    --lc-time=locale
    • Like --locale, but only sets the locale in the specified category.

      --locale ライクですが, 指定されたカテゴリのロケールのみをセットします.

  • --no-locale
    • Equivalent to --locale=C.

      --locale=C と同等です.

  • -N
    --no-sync
    • By default, initdb will wait for all files to be written safely to disk. This option causes initdb to 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.

      デフォルトで, initdb はすべてのファイルが安全にディスクに書込まれることを待ちます. このオプションは initdb を待つことなくリターンするようにします, それは高速ですが, その後のシステムクラッシュが破損したデータディレクトリをそのままにすることを意味します. 一般的に, このオプションはテストで便利ですが, プロダクションインストールの作成時には使うべきではありません.

  • --pwfile=filename
    • Makes initdb read the database superuser's password from a file. The first line of the file is taken as the password.

      initdb がファイルからデータベーススーパーユーザのパスワードを読むようにします. ファイルの最初の行がそのパスワードとしてとられます.

  • -S
    --sync-only
    • Safely write all database files to disk and exit. This does not perform any of the normal initdb operations.

      すべてのデータベースファイルをディスクに安全に書込んで終了します. これは通常の initdb オペレーションのいずれも実行しません.

  • -T config
    --text-search-config=config
    • Sets the default text search configuration. See default_text_search_config for further information.

      デフォルトのテキスト検索構成をセットします. 詳細は default_text_search_config を参照してください.

  • -U username
    --username=username
    • Selects the user name of the database superuser. This defaults to the name of the effective user running initdb. It is really not important what the superuser's name is, but one might choose to keep the customary name postgres, even if the operating system user's name is different.

      データベーススーパーユーザのユーザ名を選択します. このデフォルトは initdb を実行している実効ユーザの名前になります. スーパーユーザの名前が何かは実際には重要ではありませんが, オペレーティングシステムのユーザ名が異なるとしても, 慣習的な名前 postgres を維持するとよいはずです.

  • -W
    --pwprompt
    • 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.

      データベーススーパーユーザを与えるために initdb がパスワードを促すようにします. もしあなたがパスワード認証を使う予定がないなら, これは重要ではありません. そうでない場合あなたはパスワードをセットアップしない限りパスワード認証は使えません.

  • -X directory
    --waldir=directory
    • This option specifies the directory where the write-ahead log should be stored.

      このオプションは先行書込みのログ (# Write Ahead Log)を格納するディレクトリを指定します.

  • --wal-segsize=size
    • Set 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.

      WAL セグメントサイズを, メガバイトでセットします. これは WAL ログの個々のファイルそれぞれのサイズです. デフォルトのサイズは 16 メガバイトです. この値は 1 と 1024 (メガバイト) の間の 2 の累乗でなければなりません. このオプションは初期化の間でのみセットできて, 後で変更することはできません.
      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.

      WAL (# Write Ahead Logging) ログの配送やアーカイブの粒度をコントロールするためにこのサイズを調整すると役立つかもしれません. また, 大量の WAL をもつデータベースでは, ディレクトリ毎の非常に多くの WAL ファイルはパフォーマンスと管理の問題になりえます. WAL ファイルサイズを増やすと WAL ファイルの数が減ります.

  • Other, less commonly used, options are also available:

    その他, 一般にあまり使われない, オプションも利用可能です:

  • -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 initdb uses to create the catalog tables. This option generates a tremendous amount of extremely boring output.

      ブートストラップバックエンドからのデバッグの出力と一般の人にとって興味の薄いいくつか他のメッセージをプリントします. ブートストラップバンクエンドはカタログテーブルを作成するために initdb が使うプログラムです. このオプションは極めて退屈なとてつもない量の出力を生成します.

  • -L directory
    • Specifies where initdb should 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.

      initdb が見つけるべきデータベースクラスタを初期化するための入力ファイルの場所を指定します. これは普通必要ではありません. もしあなたがそのロケーションを明示的に指定する必要があるならあなたにそう伝えられるでしょう.

  • -n
    --no-clean
    • By default, when initdb determines 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.

      デフォルトでは, initdb がデータベースクラスタの作成をエラーが妨げたと判断すると, そのジョブがフィニッシュできないとわかる前に作成したと思われるすべてのファイルを削除します. このオプションは片付けを禁止するのでデバッギングに役立ちます.

  • Other options:

    他のオプション:

  • -V
    --version
    • Print the initdb version and exit.

      initdb のバージョンを出力して終了します.

  • -?
    --help
    • Show help about initdb command line arguments, and exit.

      initdb コマンドライン引数についての help を表示して, 終了します.




環境 :ENVIRONMENT




  • PGDATA
    • Specifies the directory where the database cluster is to be stored; can be overridden using the -D option.

      データベースクラスタが格納されるディレクトリを指定します; -D でオーバライドできます.

  • PG_COLOR
    • Specifies whether to use color in diagnostic messages. Possible values are always, auto and never.

      診断メッセージでカラーを使うかどうかを指定します. 利用可能な値は always, auto および never です.

  • 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).

      作成されたデータベースクラスタのデフォルトタイムゾーンを指定します. この値は完全なタイムゾーン名でなければなりません (セクション 8.5.3 を参照してください).

  • This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 33.14).

    このユーティリティは, この他のほとんどの PostgreSQL ユーティリティと同様に, libqg によってサポートされる環境変数も使います (セクション 33.14 を参照してください).




ノート :NOTES



initdb can also be invoked via pg_ctl initdb.

initdb は pg_ctl initdb を介して呼びだすこともできます.


関連項目 :SEE ALSO



pg_ctl(1), postgres(1)


NEXT



次回は、Mod Perl2 の「 Documentation / Tutorials 」を確認する前に、本文中で言及のあった More Tuning Advice "Stas Bekman's Performance Guide" のリンク先「 Documentation / 1.0 / mod_perl 1.0 User Guide / Performance Tuning 」を「 mod_perl 」公式サイト (https://perl.apache.org/index.html) より確認する予定です。


参考情報は書籍「 続・初めての Perl 改訂版 」, 「 Effective Perl 第 2 版 」を中心に perldoc, Wikipedia および各 Web サイト。それと詳しい先輩。

目次 - Perl Index























同じカテゴリー(Perl_7)の記事
 Perl mp2 翻訳 Web コンテンツ圧縮の FAQ (d228) (2023-10-11 23:49)
 Perl mp2 翻訳 既知のブラウザのバグの回避策をいくつか (d227) (2023-05-26 15:41)
 Perl mp2 翻訳 Perl と Apache でのキュートなトリック (d226) (2023-05-19 17:05)
 Perl mp2 翻訳 テンプレートシステムの選択 (d225) (2022-08-15 22:23)
 Perl mp2 翻訳 大規模 E コマースサイトの構築 (d224) (2022-06-15 20:43)
 Perl mp2 翻訳 チュートリアル (d223) (2022-06-15 20:42)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。

Llama
リャマ
TI-DA
てぃーだブログ
プロフィール
セラ (perlackline)
セラ (perlackline)
QRコード
QRCODE
オーナーへメッセージ

PAGE TOP ▲