createuser

Name

createuser  --  Create a new Postgres user 新規 Postgres ユーザを作成する

Synopsis

createuser [ username ]
createuser [ -h host ] 
    [ -p port ]
    [ -i userid ] 
    [ -d | -D ] [ -u | -U ]
    [ username ]
  

入力

-h host

Specifies the hostname of the machine on which the postmaster is running. Defaults to using a local Unix domain socket rather than an IP connection.

postmaster が起動しているマシンの ホスト名を定義します。デフォルトは、IP 接続ではなく、 ローカル Unix ドメインソケットを使います。

-p port

Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the postmaster is listening for connections. The port number defaults to 5432, or the value of the PGPORT environment variable (if set).

postmaster が接続の為に監視する インターネット TCP/IP ポート、あるいはローカル Unix ドメイン ソケットファイル拡張子を定義します。デフォルトポートは 5432 、あるいは (もし、設定されている場合は) 環境変数 PGPORT の値です。

-d

Allows the user to create databases.

このユーザにデータベースを作ることを許します。

-D

Forbids the user to create databases.

このユーザにデータベースを作ることを禁止します。

-i userid

Specifies the numeric identifier to be associated with this user. This identifier must be unique among all Postgres users, and is not required to match the operating system UID. You will be prompted for an identifier if none is specified on the command line, and it will suggest an identifier matching the UID.

ユーザに関連付けされる数値型の識別子 (ID) を定義します。 この識別子は Postgres の全ての ユーザに対し一意でなければなりません。また、これは オペレーティングシステムの UID と一致する必要は有りません。 識別子をコマンドラインで定義しなかった場合、UID と同じ識別子 の使用を促されます。

-u

Allows the user to create other users.

このユーザに他のユーザを作ることを許します。

-U

Forbids the user to create other users.

このユーザに他のユーザを作ることを禁止します。

username

Specifies the name of the Postgres user to be created. This name must be unique among all Postgres users. You will be prompted for a name if none is specified on the command line.

登録する Postgres ユーザの名前を 定義します。 このユーザ名は Postgres の全ての ユーザに対し一意でなければいけません。 ユーザ名をコマンドラインで定義しなかった場合、後からユーザ名 の入力を促されます。

出力

createuser will add an entry in the pg_user or pg_shadow system table.

createuser は、 pg_user 、または pg_shadow といったシステムテーブルに 登録を加えます。

Connection to database 'template1' failed. connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port 'port'? createuser: database access failed.

createuser could not attach to the postmaster process on the specified host and port. If you see this message, ensure that the postmaster is running on the proper host and that you have specified the proper port. If your site uses an authentication system, ensure that you have obtained the required authentication credentials.

createuser が指定されたホストと ポート上の postmaster プロセスに 接続することができませんでした。もしこのメッセージが表示さ れた場合、postmaster が正しいホ スト上で動作していることと、正しいポートを指定したことを 確認してください。もしサイトが認証システムを使っている場合、 必要な認証資格を受けていることを確認してください。

Connection to database 'template1' failed. FATAL 1: SetUserId: user 'username' is not in 'pg_shadow' createuser: database access failed.

You do not have a valid entry in the relation pg_shadow and and will not be allowed to access Postgres. Contact your Postgres administrator.

pg_shadow 表に有効な登録が無く、 そして Postgres にアクセス することを許されていません。 Postgres の管理者に連絡して ください。

createuser: username cannot create users.

You do not have permission to create new users; contact your Postgres site administrator.

新規ユーザを作る権利を持っていません; Postgres のサイト管理者に連絡して ください。

createuser: user "username" already exists

The user to be added already has an entry in the pg_shadow class.

登録しようとしているユーザは既に pg_shadow クラスに登録されています。

database access failed

An internal error occurred in psql or in the backend server. Ensure that your site administrator has properly installed Postgres and initialized the site with initdb.

psql 内か、あるいはバックエンド サーバ内で内部エラーが発生しました。サイト管理者が正しく Postgres をインストールし、 initdb を使って初期化したか確認 してください。

Note: createuser internally runs CREATE USER from psql while connected to the template1 database.

createuser は、内部的には psqltemplate1 データベースに接続している 間に、CREATE USER を動かします。 (訳注: v6.5.3 では、pg_shadow テーブルに新しいユーザの エントリを直接挿入しているようです。v7.0 では、SQL の CREATE USER を使用しています。)

説明

createuser creates a new Postgres user. Only users with usesuper set in the pg_shadow class can create new Postgres users. As shipped, the user postgres can create users.

createuser は、新規 Postgres ユーザを作成します。 pg_shadow クラスに usesuper がセットされているユーザだけが 新規 Postgres ユーザを作成できます。 出荷時点では、postgres というユーザが ユーザを作成できます。

createuser is a shell script that invokes psql. Hence, a postmaster process must be running on the database server host before createuser is executed. The PGOPTION and PGREALM environment variables will be passed on to psql and processed as described in psql.

createuser は、 psql を呼び出すシェルスクリプトです。 その為、postmaster プロセスが、 createuser の実行以前に、 データベースサーバのホスト上で起動していなければなりません。 PGOPTIONPGREALM という 環境変数が、psql に渡され、そして 実行されます。詳細は、 psql で説明されて います。

Once invoked, createuser will ask a series of questions to obtain parameters not specified on the command line. The new user's database login name and a numeric user identifier must be specified.

createuser が一度呼び出されると、 コマンドライン上に指定されなかったパラメータを得るために 一連の質問をします。 新規ユーザのデータベースログイン名と数値型のユーザ識別子は 必ず指定しなければいけません。

Note: The Postgres user identifier does not need to be the same as the user's Unix UID. However, typically they are assigned to be the same.

Postgres のユーザ識別子と、 ユーザの Unix UID と同じである必要は有りませんが、 一般的にはそれらは同じ物が割り当てられます。

You must also describe the privileges of the new user for security purposes. Specifically, you will be asked whether the new user should be able to act as Postgres super-user, whether the new user may create new databases and whether the new user is allowed to create other new users.

さらに、セキュリティ目的のために新規ユーザの権限を記述 しなくてはなりません。 明確に言えば、新規ユーザが Postgres のスーパーユーザを務めるべきかどうか、新しいデータベースを 作ってもよいかどうか、そして他の新規ユーザを作ることを許される べきかどうかが尋ねられます。