Description
This is probably incredibly low on the priority list, but it just occurred to me that there is no has_comment() function. I don't think we need hasnt_comment(), but it could be done if it was simple as doing "select not has_comment(...)".
There are 2 paths to take on this if done:
- has_comment(name, type [,comment] [,description]) -- where type is database, schema, function, table, ...
- has_db_comment(), has_schema_comment(), has_function_comment(), ...
It gets a little crazy because just about every type of object can have a comment. I think I'd rather do 1 to avoid a proliferation of functions.
I'm not sure if we want to check if the object simply has a comment which would be "has_comment()", or if we'd care about know that the comment value is what we expect which I think would work better with "comment_is()". Or do we need both? :)
You can see the comments by adding "+" to almost any command in psql, e.g. \l+, \dt+, \d+, \dn+, etc. The comment will show in the "Description" column. The value gets there with the command COMMENT ON {object} {name} IS '{description}';
hence has_comment() but I suppose we could call it has_description().