COMMENT ON COLUMN

Adds, revises, or removes a comment on a column in a table or projection.

Adds, revises, or removes a comment on a column in a table or projection. Each object can have one comment. Comments are stored in the COMMENTS system table.

Syntax

COMMENT ON COLUMN [[database.]schema.]object.column IS {'comment' | NULL}

Arguments

[database.]schema

Database and schema. The default schema is public. If you specify a database, it must be the current database.

object
Name of the table or projection containing the column.
column
Name of the column to which the comment applies.
comment | NULL
Comment text to add, or NULL to remove an existing comment. The new value replaces any existing comment for this column.

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

Privileges

Non-superuser: object owner

Examples

The following example adds a comment for a table column:

=> COMMENT ON COLUMN store.store_sales_fact.transaction_time IS 'GMT';

You can also add comments to columns in projections:

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

To remove a comment, specify NULL:

=> COMMENT ON COLUMN store.store_sales_fact.transaction_time IS NULL;