如何添加排序键表列使用alter命令,在AWS红移 [英] how to Add sort key to table column with alter command in aws redshift

查看:349
本文介绍了如何添加排序键表列使用alter命令,在AWS红移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加排序键列在一个表中,但在创建表。那么,有没有命令,通过它我们可以增加排序键的列(场)。

i want to add sort key to a column in a table but the table is created. so is there any command by which we can add sort key to the column(field).

在此先感谢。

推荐答案

目前,我认为它不可能的(希望这将在未来改变)。在过去,当我遇到这种情况我创建了一个新表并复制从旧的数据到它。

At the moment I think its not possible (hopefully that will change in the future). In the past when I ran into this kind of situation I created a new table and copied the data from the old one into it.

从<一个href="http://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html">http://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html:

ADD [COLUMN]栏位   将带有指定名称的表中的列。可以在每个ALTER TABLE语句添加一列。

ADD [ COLUMN ] column_name Adds a column with the specified name to the table. You can add only one column in each ALTER TABLE statement.

您不能添加一列,是分布键(DISTKEY)或表的排序键(SORTKEY)。

您不能使用ALTER TABLE ADD COLUMN命令修改下表和列属性:

You cannot use an ALTER TABLE ADD COLUMN command to modify the following table and column attributes:

唯一的

PRIMARY KEY

PRIMARY KEY

参考(外键)

IDENTITY

最大列名长度为127个字符;更长的名称被截断为127个字符。列可以在一个单一的表中定义的最大数量是1600。

The maximum column name length is 127 characters; longer names are truncated to 127 characters. The maximum number of columns you can define in a single table is 1,600.

这篇关于如何添加排序键表列使用alter命令,在AWS红移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆