LoginSignup
5
5

More than 5 years have passed since last update.

[メモ書き] PostgreSQL(ポスグレ)でダンプと展開

Posted at

Q. PostgreSQLでダンプと注入したいんだけど

A. pg_dump ダンプして psql -fで注入

ダンプはコレ

pg_dump your_db_name > ./db_dump.sql

注入はコレ

psql -d your_new_db_name -f db_dump.sql

  • 注入する先のDBは(今回の例で言うとyour_new_db_name)は作りたてホカホカにしとく必要があります.
作りたてホカホカとは

以下psqlコンソール

drop database your_new_db_name;

create database your_new_db_name;

(userオプションとかはよしなに)

5
5
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
5
5