Skip to content

add has_comment() #322

Open
Open
@kbrannen

Description

@kbrannen

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:

  1. has_comment(name, type [,comment] [,description]) -- where type is database, schema, function, table, ...
  2. 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().

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions