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 5 years have passed since last update.

PostgreSQL

0
Posted at

データベース起動

psql -U postgres

データベースバージョン確認

psql --version

データベースの作成

CREATE DATABASE [database名] ;

ユーザ切り替え

\connect - <ユーザ名>

データベース表示

¥l

macOS の場合 起動

brew services start postgresql

起動

$ rm -f /usr/local/var/postgres/postmaster.pid
$ brew services start postgres

停止

brew services stop postgresql

下記エラー等発生時解決コマンド

psql: error: could not connect to server: No such file or directory

brew services restart postgresql

PostgreSQL のユーザーには、つぎの 3 種類があります。
一般ユーザー
DB 作成権限ユーザー
スーパー・ユーザー (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?