COMMENT ON TABLE

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

Syntax

COMMENT ON TABLE [ schema.]table‑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
table‑name

Specifies the name of the table with which to associate the comment.

comment

Specifies the text of the comment to add. Enclose the text of the comment within single-quotes. If a comment already exists for this table, the comment you enter here 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 a previously added comment.

Privileges

Examples

The following example adds a comment to the promotion_dimension table:

=> COMMENT ON TABLE promotion_dimension IS '2011 Promotions';

The following examples remove a comment from the promotion_dimension table:

=> COMMENT ON TABLE promotion_dimension IS NULL;
=> COMMENT ON TABLE promotion_dimension IS '';

See Also