LoginSignup
0
2

More than 3 years have passed since last update.

リモートサーバのPostgreSQLからpg_dumpする

Last updated at Posted at 2019-06-17

コマンド

$ 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 出力フォーマット
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2