0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

postgresqlのDBを削除して再作成する

Last updated at Posted at 2022-07-25

まずはコネクションを削除

select pg_terminate_backend(pid) from pg_stat_activity where datname = 'DBの名前';

DBを削除

削除したいDBじゃないDBに移動して以下を実行する。

drop database DBの名前;

DBを再作成

create database DBの名前;
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?