* ALTER TABLE [#c87a7a78]

** NOT NULL制約をつける [#x54cf7ec]
 ALTER TABLE users ALTER tel SET not null;

** ユニーク制約をつける [#ob34c449]
 ALTER TABLE member ADD CONSTRAINT login_id_passwd_key UNIQUE (login_id, passwd)

** 主キーの削除 [#b1811695]
 ALTER TABLE users DROP CONSTRAINT users_pkey;

** 主キーの追加 [#o0b671a5]
 ALTER TABLE users ADD primary key ( user_id );

** 型変更 [#c6fcbacd]
 ALTER TABLE users ALTER birth_day TYPE timestamp
birth_dayを(date型などから)timestamp型に変える。

** 参考 [#h40438a3]
http://www.postgresql.jp/document/current/html/sql-altertable.html

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS