您的位置:首页 >> 数据库 >> PostgreSQL >> 正文
RSS
 

How to change columns in the database(postgre)

http://www.rdxx.com 06年06月19日 15:34 Blog.ChinaUnix.net 我要投稿

关键词: POST , Database , columns , Tab , ASE , Column
From Lei Yaxiong technical diary.

How to change columns in the databaseAccording to requirement analysis and design, I must change some columns in the tables of the database. Then I read some commands about how to change columns in the database.The ISO standard provides an ALTER TABLE statement for changing the structure of a table once it has been created. The definition of the ALTER TABLE statement in the ISO standard consistent of six options to: add a new column to a table drop a column from a table add a new table constraint drop a table constraint set a default for a column drop a default for columnALTER TABLE TableName[ADD [COLUMN] columnName dataType [NOT NULL][UNIQUE][DEFAULT defaultOption][CHECK (searchCondition)]][DROP [COLUMN] columnName [RESTRAINT| CASCADE]][ADD [CONSTRAINT [ConstraintName]] tableConstraintDefinition][DROP [CONSTRAINT] constraintName [RESTRAINT| CASCADE]][ALTER [COLUMN] SET DEFAULT defaultOption][ALTER [COLUMN] DROP DEFAULT]


 
 
标签: POST , Database , columns , Tab , ASE , Column 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站