.\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... .\" $Header: /usr/local/cvsroot/pgsql/src/man/pgintro.1,v 1.4 1998/04/15 16:44:36 momjian Exp $ .\" .\" Japanese Version Copyright (c) 1998 Michihide Hotta .\" all rights reserved. .\" Translated Wed Jun 3 18:46:34 JST 1998 .\" by Michihide Hotta .\" .TH PGINTRO UNIX 11/05/95 PostgreSQL PostgreSQL .SP INFORMATION UNIX 11/05/95 .BH "SECTION 2 - Unix COMMANDS (Unix)" .\"0 .SH "OVERVIEW" .SH "概要" .\"0 This section outlines the interaction between Postgres and .\"0 the operating system. In particular, this section describes .\"0 the Postgres support programs that are executable as Unix .\"0 commands. この章では、Postgres とオペレーティング・システム間のやりとりに ついての概要を説明する。特にこの章では、Unix コマンドとして実行 される Postgres サポートプログラムについて記述する。 .\"0 .SH TERMINOLOGY .SH 専門用語 .\"0 In the following documentation, the term .\"0 .IR site .\"0 may be interpreted as the host machine on which Postgres is installed. .\"0 Since it is possible to install more than one set of Postgres .\"0 databases on a single host, this term more precisely denotes any .\"0 particular set of installed Postgres binaries and databases. 以下の文書では .IR サイト という言葉を、Postgres がインストールされたホストマシンの意味で 使用することがある。1 つのホスト上に 1 つ以上の Postgres データ ベースをインストールすることができる以上、この言葉は、インストール された Postgres バイナリおよびデータベースのある特定のセットを、 より正確に意味することになる。 .PP .\"0 The .\"0 .IR "Postgres super-user" .\"0 is the user named \*(lqpostgres\*(rq who owns the Postgres .\"0 binaries and database files. As the database super-user, all .\"0 protection mechanisms may be bypassed and any data accessed .\"0 arbitrarily. In addition, the Postgres super-user is allowed to execute .\"0 some support programs which are generally not available to all users. .\"0 Note that the Postgres super-user is .\"0 .IR not .\"0 the same as the Unix super-user, .\"0 .IR root , .\"0 and should have a non-zero userid for security reasons. .IR "Postgres のスーパーユーザ" は、Postgres のバイナリとデータベースを所有する、 \*(lqpostgres\*(rq という名前のユーザである。データベースのスーパーユーザに対しては すべての保護メカニズムが無視され、いかなるデータも独占的に アクセスできる。これに加えて Postgres のスーパーユーザは、 一般的に全ユーザが使用できるわけではないいくつかのサポート プログラムを実行することができる。Postgres のスーパーユーザは、 Unix のスーパーユーザ .IR root で .IR あってはならず 、また、セキュリティ的な理由により非 0 のユーザ ID を持つべきである。 .PP .\"0 The .\"0 .IR "database base administrator" .\"0 or DBA, is the person who is responsible for installing Postgres to .\"0 enforce a security policy for a site. The DBA can add new users by .\"0 the method described below .\"0 and maintain a set of template databases for use by .\"0 .IR createdb (1). .IR "データベース管理者" または DBA は、そのサイトに際してセキュリティ・ポリシーを 確保するために、Postgres のインストールに責任を負う人である。 .PP .\"0 The .\"0 .IR postmaster .\"0 is the process that acts as a clearing-house for requests to the Postgres .\"0 system. .\"0 Frontend applications connect to the .\"0 .IR postmaster , .\"0 which keeps tracks of any system errors and communication between the .\"0 backend processes. The .\"0 .IR postmaster .\"0 can take several command-line arguments to tune its behavior. .\"0 However, .\"0 supplying arguments is necessary only if you intend to run multiple .\"0 sites or a non-default site. See .\"0 .IR postmaster (1) .\"0 for details. .IR postmaster は、Postgres システムへの要求に際しての情報センターとして動作 するプロセスである。フロントエンド・アプリケーションは、すべての システムエラーやバックエンドプロセスとの通信を追跡する .IR postmaster に接続する。 .IR postmaster は、その振る舞いを調整するために、いくつかのコマンドライン引数を 取ることができる。しかしながら、複数のサイトやデフォルトではない サイトを運用したい場合にのみ、引数を指定すれば良い。詳細は .IR postmaster (1) を参照のこと。 .PP .\"0 The .\"0 .IR "Postgres backend" .\"0 (the actual executable program called "postgres") may be executed .\"0 directly from the user shell by the .\"0 Postgres super-user (with the database name as an argument). However, .\"0 doing this bypasses the shared buffer pool and lock table associated .\"0 with a postmaster/site, therefore this is not recommended in a multiuser .\"0 site. .IR "Postgres バックエンド" ("postgres" と呼ばれる、実際に動作可能なプログラム)は、Postgres スーパーユーザにより(データベース名を引数として)ユーザシェルから直接 起動される。しかしながらこれを行うと、、サイト毎の postmaster に 関連付けられている共有バッファプールやロックテーブルなどがバイパス されてしまう。このため、マルチユーザ・モードでは直接実行は推奨 されていない。 .\"0 .SH NOTATION .\"0 \*(lq.../\*(rq at the front of a file name is used to represent the .\"0 path to the Postgres super-user's home directory. Anything in brackets .\"0 (\*(lq[\*(rq and \*(lq]\*(rq) is optional. Anything in braces .\"0 (\*(lq{\*(rq and \*(lq}\*(rq) can be repeated 0 or more times. .\"0 Parentheses (\*(lq(\*(rq and \*(lq)\*(rq ) are used to group boolean .\"0 expressions. \*(lq|\*(rq is the boolean operator .SH 注意事項 ファイル名の最初にある \*(lq.../\*(rq は、Postgres スーパーユーザの ホームディレクトリへのパスを示している。 (\*(lq[\*(rq と \*(lq]\*(rq) の中にあるものはオプションである。 (\*(lq{\*(rq と \*(lq}\*(rq) の中にあるものは 0 回以上繰り返される。 (\*(lq(\*(rq と \*(lq)\*(rq ) の中にあるものは グループのブール表現として使用される。 \*(lq|\*(rq はブール演算子の .SM OR である。 .\"0 .SH "USING Postgres FROM Unix" .\"0 All Postgres commands that are executed directly from a Unix shell are .\"0 found in the directory \*(lq.../bin\*(rq. Including this directory in .\"0 your search path will make executing the commands easier. .SH "Postgres を Unix から使う" Unix シェルから直接実行されるすべての Postgres コマンドは、 \*(lq.../bin\*(rq から検索される。このディレクトリをあなたの検索 パスに追加してやれば、簡単にコマンドを実行できるようになる。 .PP .\"0 A collection of system catalogs exist at each site. These include a .\"0 class (\*(lqpg_user\*(rq) that contains an instance for each valid .\"0 Postgres user. The instance specifies a set of Postgres privileges, .\"0 such as .\"0 the ability to act as Postgres super-user, the ability to create/destroy .\"0 databases, and the ability to update the system catalogs. A Unix .\"0 user cannot do anything with Postgres until an appropriate instance is .\"0 installed in this class. Further information on the system catalogs .\"0 is available by running queries on the appropriate classes. 各サイトにはシステムカタログ群がある。これらには、有効な Postgres の各ユーザのインスタンスが入っている (\*(lqpg_user\*(rq) クラスが 含まれる。このインスタンスでは、Postgres のスーパーユーザとして振る 舞うことができるか、データベースを生成/削除することができるか、 システムカタログを更新することができるかなどの、Postgres における 権限のセットが指定されている。このクラスに適切なインスタンスが インストールされて初めて、Unix のユーザは Postgres に対して何かの 操作を行うことができるようになる。システムカタログ上における詳細 情報を得るには、適切なクラスにおいて問い合わせを発行してほしい。 .\"0 .SH "Security" .\"0 .SP SECURITY UNIX 03/12/94 .\"0 .SH "USER AUTHENTICATION" .\"0 .IR Authentication .\"0 is the process by which the backend server and .\"0 .IR postmaster .\"0 ensure that the user requesting access to data is in fact who he/she .\"0 claims to be. All users who invoke Postgres are checked against the .\"0 contents of the \*(lqpg_user\*(rq class to ensure that they are .\"0 authorized to do so. However, verification of the user's actual .\"0 identity is performed in a variety of ways. .SH "セキュリティ" .SP SECURITY UNIX 03/12/94 .SH "ユーザ認証" .IR 認証 は、バックエンドサーバと .IR postmaster が、データにアクセスしようとしているユーザが本当に要求する権限を 持っているかどうかを確認するための処理である。Postgres を呼び出す すべてのユーザについて、彼らがその操作を行う権限を確認するのに、 \*(lqpg_user\*(rq クラスの内容に対してのチェックが行われる。 しかしながら、ユーザ識別チェックはいろいろな方法で実行される。 .\"0 .SS "From the user shell" .\"0 A backend server started from a user shell notes the user's (effective) .\"0 user-id before performing a .\"0 .IR setuid (3) .\"0 to the user-id of user \*(lqpostgres\*(rq. The effective user-id is used .\"0 as the basis for access control checks. No other authentication is .\"0 conducted. .SS "ユーザシェルから" ユーザシェルから起動されたバックエンドサーバは、ユーザ \*(lqpostgres\*(rq のユーザ ID に .IR setuid (3) する前に、ユーザの(実効)ユーザ ID に注目する。実効ユーザ ID は、 アクセス制御チェックの基準として使われるものである。それ以外の 認証は行われない。 .\"0 .SS "From the network" .\"0 If the Postgres system is built as distributed, access to the .\"0 Internet TCP port of the .\"0 .IR postmaster .\"0 process is available to anyone. The DBA configures the .\"0 pg_hba.conf file in the PGDATA directory to specify what .\"0 authentication system is to be used. .\"0 according to the host making the connection and which .\"0 database it is connecting to. See pg_hba.conf(5) for .\"0 a description of the authentication systems available. .\"0 Of course, host-based authentication is not fool-proof in .\"0 Unix, either. It is possible for determined intruders to .\"0 also masquerade the origination host. Those security issues .\"0 are beyond the scope of Postgres. .SS "ネットワークから" ネットワークに開放するように Postgres システムが構築されていれば、 .IR postmaster プロセスのインターネット TCP ポートへのアクセスは誰にでも行える。 DBA は、どのホストが接続を確立でき、またどのデータベースに接続 するかに応じて、どの認証システムを使用すべきかを PGDATA ディレクトリにある pg_hba.conf ファイルに設定する。使用可能な 認証システムに関しては、 pg_hba.conf(5) を参照のこと。 もちろんホストベースの認証は、Unix では絶対安全なものではない。 確信犯である侵入者は、オリジナルのホストに成りすますことも可能 なのだから。これらのセキュリティの問題点は Postgres がカバー できる範囲を超えている。 .PP .\"0 .SH "ACCESS CONTROL" .\"0 Postgres provides mechanisms to allow users to limit the access to .\"0 their data that is provided to other users. .SH "アクセス制御" Postgres ではユーザに対して、他のユーザへ提供された彼らのデータ へのアクセスを制限するためのメカニズムを提供している。 .\"0 .SS "Database superusers" .\"0 Database super-users (i.e., users who have \*(lqpg_user.usesuper\*(rq .\"0 set) silently bypass all of the access controls described below with .\"0 two exceptions: manual system catalog updates are not permitted if the .\"0 user does not have \*(lqpg_user.usecatupd\*(rq set, and destruction of .\"0 system catalogs (or modification of their schemas) is never allowed. .SS "データベースのスーパーユーザ" データベースのスーパーユーザ( \*(lqpg_user.usesuper\*(rq セットを持つ ユーザ)は、「ユーザが \*(lqpg_user.usecatupd\*(rq セットを持って いない場合は、手作業によるシステムカタログの更新は許されない」、 および「システムカタログの破壊(またはそれらスキームの改竄)は 許されない」という 2 つの例外により、以下に示すすべてのアクセス 制御を黙ってバイパスする。 .\"0 .SS "Access Privilege" .\"0 The use of access privilege to limit reading, writing and setting .\"0 of rules on classes is covered in .\"0 .IR "grant/revoke" (l). .SS アクセス特権 .IR "grant/revoke" (l) により、クラスの読み書きおよびルールの設定を制限するためのアクセス 特権を使うことができる。 .\"0 .SS "Class removal and schema modification" .\"0 Commands that destroy or modify the structure of an existing class, .\"0 such as .\"0 .IR "alter" , .\"0 .IR "drop table" , .\"0 and .\"0 .IR "drop index" , .\"0 only operate for the owner of the class. As mentioned above, these .\"0 operations are .\"0 .BR never .\"0 permitted on system catalogs. .SS "クラスの削除とスキーマの改竄" .IR "alter" , .IR "drop table" , および .IR "drop index" , のように、存在するクラスの構造を破壊したり改竄したりするコマンドは、 その所有するクラスに対してのみ行うことができる。上で述べたように、 これらの操作をシステムカタログに対して許可 .BR してはならない。 .\"0 .SH "FUNCTIONS AND RULES" .\"0 Functions and rules allow users to insert code into the backend server .\"0 that other users may execute without knowing it. Hence, both .\"0 mechanisms permit users to .\"0 .BR "trojan horse" .\"0 others with relative impunity. The only real protection is tight .\"0 control over who can define functions (e.g., write to relations with .\"0 SQL fields) and rules. Audit trails and alerters on .\"0 \*(lqpg_class\*(rq, \*(lqpg_user\*(rq and \*(lqpg_group\*(rq are also .\"0 recommended. .SH "関数とルール" ユーザは、関数とルールにより、他のユーザが何も知らないうちに バックエンドサーバに対してコードを追加することができる。このため この双方のメカニズムにより、ユーザは何のとがめもなく .BR "トロイの木馬" などをしかけることができる。唯一現実的な保護策としては、関数と ルールを定義する(すなわち SQL フィールドにリレーションを張る) ことができるユーザを厳しく制御することである。 \*(lqpg_class\*(rq, \*(lqpg_user\*(rq および \*(lqpg_group\*(rq に対して変更の追跡をしたり、警告を発するようにすることも 推奨される。 .\"0 .SS "Functions" .\"0 Functions written in any language except SQL .\"0 run inside the backend server .\"0 process with the permissions of the user \*(lqpostgres\*(rq (the .\"0 backend server runs with its real and effective user-id set to .\"0 \*(lqpostgres\*(rq). It is possible for users to change the server's .\"0 internal data structures from inside of trusted functions. Hence, .\"0 among many other things, such functions can circumvent any system .\"0 access controls. This is an inherent problem with user-defined C .\"0 functions. .SS 関数 SQL を除く任意の言語で書かれた関数は、バックエンドプロセスの内部 において、ユーザ \*(lqpostgres\*(rq の権限の元で(バックエンド サーバは、\*(lqpostgres\*(rq) にセットされた実ユーザ ID および 実効ユーザ ID で動作する)で実行される。ユーザは、信頼される関数の 内部からサーバの内部データ構造体を変更することも可能である。 このため、関数など多くの事柄の間でいかなるシステムのアクセス制御 をも迂回することができる。これは、ユーザ定義の C 関数から引き ずっている問題である。 .\"0 .SS "Rules" .\"0 Like SQL functions, rules always run with the identity and .\"0 permissions of the user who invoked the backend server. .SS ルール SQL 関数のように、ルールは常にその ID と、バックエンドサーバを 起動したユーザの権限の元で実行される。 .\"0 .SH "SEE ALSO" .SH "関連事項" .nf abort(l) declare(l) large_objects(3) alter_table(l) delete(l) libpq(3) alter_user(l) destroydb(1) listen(l) begin(l) destroyuser(1) load(l) bki(5) drop(l) lock(l) catalogs(3) drop_aggregate(l) move(l) cleardbdir(1) drop_database(l) notify(l) close(l) drop_function(l) oracle_compat(3) cluster(l) drop_index(l) page(5) commit(l) drop_language(l) pg_dump(1) copy(l) drop_operator(l) pg_dumpall(1) create_aggregate(l) drop_rule(l) pg_hba(conf(5) create_database(l) drop_sequence(l) pg_passwd(1) create_function(l) drop_table(l) pgbuiltin(3) create_index(l) drop_trigger(l) pgintro(1) create_language(l) drop_type(l) postgres(1) create_operator(l) drop_user(l) postmaster(1) create_rule(l) drop_view(l) psql(1) create_sequence(l) ecpg(1) reset(l) create_table(l) end(l) revoke(l) create_trigger(l) explain(l) rollback(l) create_type(l) fetch(l) select(l) create_user(l) grant(l) set(l) create_version(l) initdb(1) show(l) create_view(l) initlocation(1) sql(l) createdb(1) insert(l) update(l) createuser(1) ipcclean(1) vacuum(l) .fi .\"0 .SH CAVEATS .SH 警告 .PP .\"0 There are no plans to explicitly support encrypted data inside of .\"0 Postgres (though there is nothing to prevent users from encrypting .\"0 data within user-defined functions). There are no plans to explicitly .\"0 support encrypted network connections, either, pending a total rewrite .\"0 of the frontend/backend protocol. (ユーザ定義関数の中で、ユーザを暗号化データに触らせないような しくみはないが、) Postgres の内部で暗号化データを明示的にサポート するための計画はない。また、暗号化されたネットワーク接続を明示的に サポートしたり、フロントエンド/バックエンドプロトコルを全面的に 書き直したりするような計画もない。 .PP .\"0 User names, group names and associated system identifiers (e.g., the .\"0 contents of \*(lqpg_user.usesysid\*(rq) are assumed to be unique .\"0 throughout a database. Unpredictable results may occur if they are .\"0 not. ユーザ名、グループ名その他関連するシステム ID (すなわち \*(lqpg_user.usesysid\*(rq の中身)は、データベースを通してユニーク であるとみなされる。この原則が守られていない場合は、予期しない 結果となることがある。 .\"0 .SH "APPENDIX: USING KERBEROS" .\"0 .SS "Availability" .SH "付録:KERBEROS(ケロベロス)の使用" .SS "可用性" .\"0 The .\"0 .IR Kerberos .\"0 authentication system is not distributed with Postgres, nor is it .\"0 available from the University of California at Berkeley. Versions of .\"0 .IR Kerberos .\"0 are typically available as optional software from operating system .\"0 vendors. In addition, a source code distribution may be obtained .\"0 through MIT Project Athena by anonymous FTP from ATHENA-DIST.MIT.EDU .\"0 (18.71.0.38). (You may wish to obtain the MIT version even if your .\"0 vendor provides a version, since some vendor ports have been .\"0 deliberately crippled or rendered non-interoperable with the MIT .\"0 version.) Users located outside the United States of America and .\"0 Canada are warned that distribution of the actual encryption code in .\"0 .IR Kerberos .\"0 is restricted by U. S. government export regulations. .IR Kerberos 認証システムは、Postgres とともに配布されてはおらず、カリフォルニア 大学バークレイ校 (UCB) から取ってこれると言うわけでもない。 .IR Kerberos のいくつかのバージョンは、一般的にはオペレーティングシステムの ベンダーからオプション・ソフトウェアとして供給されるものである。 加えて、ソースコードの配布は MIT Project Athena を通して ATHENA-DIST.MIT.EDU(18.71.0.38) から anonymous FTP で取得できる かもしれない。(ベンダーが移植したものの中には、故意に機能を限定 していたり MIT バージョンとは互換性がないようなものも見受けられる ので、もしあなたがベンダー提供のものを持っていたとしても、MIT バージョンのものが欲しいと思うかもしれない。) 米国およびカナダ 以外に住むユーザについては、 .IR Kerberos 内の実際の暗号化コードは米国政府の輸出法規により制限されている ので注意してほしい。 .PP .\"0 Any additional inquiries should be directed to your vendor or MIT .\"0 Project Athena (\*(lqinfo-kerberos@ATHENA.MIT.EDU\*(rq). Note that FAQLs .\"0 (Frequently-Asked Questions Lists) are periodically posted to the .\"0 .IR Kerberos .\"0 mailing list, \*(lqkerberos@ATHENA.MIT.EDU\*(rq (send mail to .\"0 \*(lqkerberos-request@ATHENA.MIT.EDU\*(rq to subscribe), and USENET .\"0 news group, \*(lqcomp.protocols.kerberos\*(rq. これ以上の問い合わせについては、あなたのベンダーかまたは、MIT Project Athena (\*(lqinfo-kerberos@ATHENA.MIT.EDU\*(rq) に 対して行ってほしい。また、FAQL (頻繁に行われる質問と回答の リスト)は、定期的に .IR Kerberos メーリングリスト \*(lqkerberos@ATHENA.MIT.EDU\*(rq ( \*(lqkerberos-request@ATHENA.MIT.EDU\*(rq に subscribe という メールを送る) や USENET ニューズグループ \*(lqcomp.protocols.kerberos\*(rq に投稿されている。 .\"0 .SS "Installation" .\"0 Installation of .\"0 .IR Kerberos .\"0 itself is covered in detail in the .\"0 .IR "Kerberos Installation Notes" . .\"0 Make sure that the server key file (the .\"0 .IR srvtab .\"0 or .\"0 .IR keytab ) .\"0 is somehow readable by user \*(lqpostgres\*(rq. .SS インストール .IR Kerberos のインストール自体は、 .IR "Kerberos Installation Notes" に詳細に述べられている。サーバ・キーファイル( .IR srvtab または .IR keytab )をどうにかしてユーザ \*(lqpostgres\*(rq から読めるようにしておく ことに注意すること。 .PP .\"0 Postgres and its clients can be compiled to use either Version 4 or .\"0 Version 5 of the MIT .\"0 .IR Kerberos .\"0 protocols by setting the .\"0 .SM KRBVERS .\"0 variable in the file \*(lq.../src/Makefile.global\*(rq to the .\"0 appropriate value. You can also change the location where Postgres .\"0 expects to find the associated libraries, header files and its own .\"0 server key file. ファイル \*(lq.../src/Makefile.global\*(rq にある変数 .SM KRBVERS を適切な値に設定すれば、Postgres とそのクライアントを、MIT .IR Kerberos プロトコルのバージョン 4 または 5 のいずれかで使うように コンパイルすることができる。また、関連ライブラリ、ヘッダ ファイル、所有するサーバ・キーファイルを、Postgres が期待 する場所に置いておくことも必要である。 .PP .\"0 After compilation is complete, Postgres must be registered as a .\"0 .IR Kerberos .\"0 service. See the .\"0 .IR "Kerberos Operations Notes" .\"0 and related manual pages for more details on registering services. コンパイルが正常に終了したら、Postgres を .IR Kerberos サービスとして登録しなければならない。サービス登録に関する詳細は、 .IR "Kerberos Operations Notes" および関連マニュアルを参照のこと。 .\"0 .SS "Operation" .\"0 After initial installation, Postgres should operate in all .\"0 ways as a normal .\"0 .IR Kerberos .\"0 service. For details on the use of authentication, see the .\"0 manual pages for .\"0 .IR postmaster (1) .\"0 and .\"0 .IR psql (1). 初期インストールの後は、すべての方法で Postgres が通常の .IR Kerberos サービスとして動作していなければならない。認証機能を使用する 際の詳細については、 .IR postmaster (1) と .IR psql (1) マニュアルページを参照のこと。 .PP .\"0 In the .\"0 .IR Kerberos .\"0 Version 5 hooks, the following assumptions are made about user .\"0 and service naming: (1) user principal names (anames) are assumed to .\"0 contain the actual Unix/Postgres user name in the first component; (2) .\"0 the Postgres service is assumed to be have two components, the service .\"0 name and a hostname, canonicalized as in Version 4 (i.e., all domain .\"0 suffixes removed). .IR Kerberos バージョン 5 においては、ユーザおよびサービスの命名に関して以下 のことが前提となっている:(1) ユーザの公式名(anames)は、最初の 構成要素として実際の Unix/Postgres ユーザ名を含むとみなされる。 (2) Postgres サービスは、バージョン 4 において正式に認められた サービス名とホスト名という 2 つの構成要素を持っていると見なされる (すなわちすべてのドメイン・サフィックスは取り除かれる)。 .PP .nf user example: frew@S2K.ORG user example: aoki/HOST=miyu.S2K.Berkeley.EDU@S2K.ORG host example: postgres_dbms/ucbvax@S2K.ORG .fi .PP .\"0 Support for Version 4 will disappear sometime after the production .\"0 release of Version 5 by MIT. MIT によるバージョン 5 の製品リリース後には、いずれバージョン 4 のサポートはなくなる。 .SH 翻訳者 堀田 倫英