LoginSignup
0
1

More than 5 years have passed since last update.

PostgreSQL 基本コマンド忘備録(createdb ~ psql ~テーブル作成)

Last updated at Posted at 2016-07-03

基本的なコマンドをメモ。

DBの作成

// shouhinn というDBを生成 エンコードにutf-8を指定
createdb shouhinn -E utf-8

DBの削除

dropdb shouhinn

PostgreSQLへの接続

// shouhinnというDBに接続する
psql shouhinn

PostgreSQLからの切断

// DBを切断する
\q

テーブルを作成する

// uriage テーブルを作成
create table uriage

テーブル名を変更する

alter table uriage rename to myuriage

テーブルの削除

drop table uriage
0
1
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
1