日期:2014-05-16 浏览次数:20352 次
ALTER TABLE products ALTER COLUMN price SET DEFAULT 7.77;
ALTER TABLE products ALTER COLUMN price TYPE numeric(10,2);
ALTER TABLE products ADD COLUMN description text;
CREATE SEQUENCE products_seq_no_seq MINVALUE 90000000 MAXVALUE 99999999 INCREMENT 1 STAR T 90000000 CYCLE;
select setval('tablename',lastvalue,true);
select setval('products',20,true);
explain analyze select * from products
copy tablename to '/database/dump.txt';
coyp tablename from '/database/dump.txt';
select * into temptable from products;
insert into temptable select * from products;