Column-Definition
Specifies the name, data type, and constraints to be applied to a column.
Syntax
column-name data-type [ column‑constraint ][…] [ ENCODING encoding-type ] [ ACCESSRANK integer ]
Parameters
| column-name |
The name of a column to be created or added. |
| data-type |
A Vertica-supported data type. When specifying the maximum column width in a |
| column‑constraint |
A constraint type that Vertica supports—for example, NOT NULL or UNIQUE. For general information, see Constraints. |
| ENCODING encoding-type |
Specifies the column encoding type, by default set to AUTO. |
| ACCESSRANK integer |
Overrides the default access rank for a column. Use this parameter to increase or decrease the speed at which Vertica accesses a column. For more information, see Overriding Default Column Ranking. |
Example
The following example creates a table named Employee_Dimension and its associated superprojection in the Public schema. The Employee_key column is designated as a primary key, and RLE encoding is specified for the Employee_gender column definition:
=> CREATE TABLE Public.Employee_Dimension (
Employee_key integer PRIMARY KEY NOT NULL,
Employee_gender varchar(8) ENCODING RLE,
Courtesy_title varchar(8),
Employee_first_name varchar(64),
Employee_middle_initial varchar(8),
Employee_last_name varchar(64)
);