destroydb

Name

destroydb  --  Remove an existing Postgres database 既存の Postgres データベース を削除します。

Synopsis

destroydb [ dbname ]
destroydb [ -h host ] [ -p port ]
    [ -i ] [ dbname ]
  

入力

-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 または、環境変数(もし設定 していれば)による番号です。

-i

Run in interactive mode. Prompts for confirmation before destroying a database.

対話モードになります。 データベースを削除する前に、確認を求められます。

dbname

Specifies the name of the database to be destroyed. The database must be one of the existing Postgres databases in this installation. dbname defaults to the value of the USER environment variable.

削除するデータベースの名前を指定します。データベースは このインストレーションの Postgres の既存のデータベースのなかの一つでなければなりません。 デフォルトの dbnameUSER の環境変数の値です。

出力

destroydb will remove files from the PGDATA/dbname/ data area for the existing database.

destroydb は、既存のデータベース のデータ領域 PGDATA/dbname/ からファイルを削除します。

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

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

destroydb は、指定したホストとポート の postmaster プロセスに接続できません。 このメッセージが表示された場合、postmaster が特定のホスト上で稼働していて、正しいポートが指定されているかどうか 確認して下さい。サイトが認証システムを使用している場合は、 必要な認証資格が交付されているかどうかの確認をして下さい。

Connection to database 'template1' failed. FATAL 1: SetUserId: user 'username' is not in 'pg_shadow' destroydb: database destroy failed on dbname.

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 管理者に 連絡を取って下さい。

ERROR: user 'username' is not allowed to create/destroy databases destroydb: database destroy failed on dbname.

You do not have permission to destroy (or create) databases. Contact your Postgres site administrator.

データベースを削除(または作成)する権限がありません。 Postgres サイト管理者に 連絡を取って下さい。

ERROR: destroydb: database 'dbname' does not exist. destroydb: database destroy failed on dbname.

The database to be removed does not have an entry in the pg_database class.

削除されるデータベースは pg_database クラスに登録されていません。

ERROR: destroydb: database 'dbname' is not owned by you. destroydb: database destroy failed on dbname.

You are not the Database Administrator (DBA) for the specified database.

指定されたデータベースのデータベース管理者 (DBA) ではありません。

destroydb: database destroy failed on dbname.

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

psql またはバックエンドサーバで 内部エラーが起こりました。サイト管理者が適切に Postgres をインストールし、その サイトを initdb で初期化したか どうか確認して下さい。

Note: destroydb internally runs DESTROY DATABASE from psql while connected to the template1 database.

destroydb の内部では、 template1 データベースに接続して、 psql から DROP DATABASE を実行します。

説明

destroydb destroys an existing Postgres database. The person who executes this command must be the database administrator, or DBA, or must be the Postgres super-user. The program runs silently; no confirmation message will be displayed. After the database is destroyed, a Unix shell prompt will reappear.

destroydb は既存の Postgres データベースを削除します。 このコマンドを実行できるのは、データベース管理者、または DBA、それと Postgres のスーパユーザでなければなりません。このプログラムは沈黙して 実行され、確認のメッセージは表示されません。 データベースが削除された後、Unix のシェルプロンプトが再表示 されます。

All references to the database are removed, including the directory containing this database and its associated files.

データベースへの全ての参照は、このデータベースのある ディレクトリとその関連したファイルと一緒に削除されます。

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

destroydbpsql を呼び出すシェルスクリプト です。したがい、postmaster プロセスは destroydb が実行される 以前に、データベースサーバホストで稼働していなければなりません。 PGOPTIONPGREALM 環境変数は psql に渡され、 psql に記載され ているように処理されます。

使用法

To destroy the database demo using the postmaster on the local host, port 5432:

ローカルホストのポート 5432 の postmaster を使用して いるデータベース demo を削除します:

    destroydb demo
   

To destroy the database demo using the postmaster on host eden, port 5000:

ホスト eden のポート 5000 の postmaster を使用している データベース demo を削除します:

    destroydb -p 5000 -h eden demo