COMMENT ON COLUMN

Adds, revises, or removes a projection column comment. You can only add comments to projection columns, not to table columns. Each object can have one comment. Comments are stored in the system table COMMENTS.

Syntax

COMMENT ON COLUMN [schema.]proj‑name.column‑name IS {'comment' | NULL}

Parameters

schema

Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example:

myschema.thisDbObject
proj‑name.column‑name Specifies the name of the projection and column with which to associate the comment.
comment

Specifies the comment text to add. If a comment already exists for this column, this comment overwrites the previous comment.

Comments can be up to 8192 characters in length. If a comment exceeds that limitation, Vertica truncates the comment and alerts the user with a message.

You can enclose a blank value within single quotes to remove an existing comment.

NULL Removes an existing comment.

Privileges

Example

The following example adds a comment to the customer_name column in the customer_dimension projection:

=> COMMENT ON COLUMN customer_dimension_vmart_node01.customer_name IS 'Last name only';

The following examples remove a comment from the customer_name column in the customer_dimension projection in two ways, using the NULL option, or specifying a blank string:

=> COMMENT ON COLUMN customer_dimension_vmart_node01.customer_name IS NULL;
=> COMMENT ON COLUMN customer_dimension_vmart_node01.customer_name IS '';