コマンド
$ pg_dump -d [データベース名] -h [ホスト名] -p [ポート] -F custom -U [ユーザ名] -W --data-only --inserts --verbose --file=[ファイル名]
Password: [パスワード]
オプション覚え書き
接続オプション
| オプション | 説明 |
|---|---|
| -d, --dbname | データベース名 |
| -h, --host | ホスト名(ドメイン、IPアドレスなど) |
| -p, --port | ポート(デフォルトは5432) |
| -U, --username | ユーザ名 |
| -w, --no-password | パスワード無しで接続 |
| -W, --password | パスワードを入力して接続 |
その他のオプション
| オプション | 説明 |
|---|---|
| -a, --data-only | データのみ(スキーマを取得しない) |
| -s, --schema-only | スキーマのみ(データを取得しない) |
| --inserts | インサート文で取得 |
| -v, --verbose | 冗長表示(作業中感が出てかっこいい) |
| -F, --format | 出力フォーマット |