COMMENT ON FUNCTION
Adds, revises, or removes a comment on a function. Each object can have one comment. Comments are stored in the system table COMMENTS
.
Syntax
COMMENT ON FUNCTION [schema.]function-name function-arg IS { 'comment' | NULL };
Parameters
schema |
Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example: myschema.thisDbObject |
function-name |
Specifies the name of the function with which to associate the comment. |
function-arg |
Specifies the function arguments. |
comment |
Specifies the comment text to add. If a comment already exists for this function, this overwrites the previous one. 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. Enclose a blank value within single quotes to remove an existing comment. |
NULL |
Removes an existing comment. |
Privileges
- Superuser: View and add comments to all objects.
- Object owner: Add or edit comments for the object.
- User: VIEW privileges on an object to view its comments.
Examples
The following example adds a comment to the macros.zerowhennull (x INT)
function:
=> COMMENT ON FUNCTION macros.zerowhennull(x INT) IS 'Returns a 0 if not NULL';
The following examples remove a comment from the macros.zerowhennull (x INT)
function in two ways by using the NULL
option, or specifying a blank string:
=> COMMENT ON FUNCTION macros.zerowhennull(x INT) IS NULL; => COMMENT ON FUNCTION macros.zerowhennull(x INT) IS '';