2001年11月26日
▽[memorandum] ADD PRIMARY KEY on PostgreSQL
作成された(ある程度データがある) Table に Priamry Key(or Foreign Key etc.) を追加する方法.=> alter table THE_TABLE rename to oldtable;
=> create table THE_TABLE ( (> test int4 PRIMARY KEY, (> test2 char(24) (> );
=> insert into THE_TABLE select * from oldtable;
=> drop table oldtable;別に難しい事はなく,単に Insert するのがミソ.
Posted by Rust Stnard at 00:00





