LoginSignup
0
1

More than 1 year has passed since last update.

PostgreSQLインストールと初期設定

Last updated at Posted at 2021-02-24

PostgreSQLをインストールしてDBへ接続する

はじめに

  本シリーズの目次はこちら

やりたいこと

PostgreSQLをインストールし、コマンドプロンプトから以下のコマンドを実行する
詳細は各記事を参照してください。

  1. 接続
    psql -h localhost -p 5432 -U postgres -d postgres
  2. DB作成
    CREATE DATABASE test_db;

  3. ロール作成 
    create role test_admin with login password 'pw_admin';
    ALTER ROLE test_admin WITH SUPERUSER;
    create role test_user1 with login password 'pw_user1';
    ALTER ROLE test_user1 WITH LOGIN;

  4. 作成したユーザで再度ログイン
    exit;
    psql -h localhost -p 5432 -U test_admin -d test_db

  5. スキーマ作成
    CREATE SCHEMA test_schema;

1.PostgreSQLをインストールする

    PostgreSQLインストール方法

2.コマンドプロンプトからPostgreSQLを使用するための設定

3.DBを作成する

参考

0
1
1

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
1