SQL 相当于 TEXT 数据类型的红移
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30919389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
redshift equivalent of TEXT data type
提问by WeaselFox
What's the best data type to use for a column in a redshift table that will hold a very long string (can be up to 50KB)?
用于保存很长字符串(最多 50KB)的 redshift 表中的列的最佳数据类型是什么?
TEXT is replaced by varchar(256)
by default. For now I used varchar(65535)
, but I'm not sure if that's the right way to do that...
varchar(256)
默认情况下替换 TEXT 。现在我使用了varchar(65535)
,但我不确定这是否是正确的方法......
Thanks
谢谢
回答by Tech Support
Text Data Type in Redshift:
Redshift 中的文本数据类型:
For Redshift Text Data Type you can use varchar(max)
or varchar(65535)
对于 Redshift 文本数据类型,您可以使用varchar(max)
或varchar(65535)
That is the maximum length of a text data type field in Redshift.
这是 Redshift 中文本数据类型字段的最大长度。
回答by Peanut
VARCHAR
, CHARACTER VARYING
and NVARCHAR
can have a length of up to 65k.
VARCHAR
,CHARACTER VARYING
并且NVARCHAR
可以具有多达的长度至65K。
Source: http://docs.aws.amazon.com/redshift/latest/dg/r_Character_types.html
来源:http: //docs.aws.amazon.com/redshift/latest/dg/r_Character_types.html