The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!
What’s the Maximum Column Size?
![[Deleted User]](https://us.v-cdn.net/6029397/uploads/defaultavatar/nD0LWW9MQTB29.jpg)
Jim Knicely authoried this tip.
There exists a maximum number of characters that can be stored in columns having a data type of VARCHAR or LONG VARCHAR. In case you’ve forgotten those maximum values for the version of Vertica you are using, there are two handy functions that provide this information.
Example:
To find the maximum characters that can be stored into VARCHAR field:
dbadmin=> SELECT get_max_attr_size(); get_max_attr_size ------------------- 65000 (1 row) dbadmin=> CREATE TABLE test (c1 VARCHAR(65001)); ERROR 3852: Length for type varchar cannot exceed 65000
To find the maximum characters that can be stored into LONG VARCHAR field:
dbadmin=> SELECT get_max_long_attr_size(); get_max_long_attr_size ------------------------ 32000000 (1 row) dbadmin=> CREATE TABLE test (c1 LONG VARCHAR(32000001)); ERROR 3852: Length for type long varchar cannot exceed 32000000
Have Fun!
0